Skip to content

Commit dba1efc

Browse files
committed
fix(release): scope contributors to tag range and drop nbsp separators
1 parent 3b24920 commit dba1efc

2 files changed

Lines changed: 5 additions & 15 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,10 @@ jobs:
243243
exit 1
244244
fi
245245
246-
tmp_logins=$(mktemp)
247-
trap 'rm -f "${tmp_logins}"' EXIT
248-
249-
# Fetch PR authors in range using base...head comparison
250-
gh pr list \
251-
--repo "${GITHUB_REPOSITORY}" \
252-
--limit 500 \
253-
--json author \
254-
--jq '.[].author.login' 2>/dev/null | sort -u | grep -ivE '^anupamme$' > "${tmp_logins}" || true
246+
tmp_merged=$(mktemp)
247+
trap 'rm -f "${tmp_merged}"' EXIT
255248
256249
# Fetch merged PRs in range using commits
257-
tmp_merged=$(mktemp)
258250
git log "${LATEST_TAG}...${RELEASE_TAG}" --pretty=format:%s \
259251
| grep -oE '#[0-9]+' \
260252
| sed 's/^#//' \
@@ -266,11 +258,9 @@ jobs:
266258
267259
if [ -s "${tmp_merged}" ]; then
268260
grep -ivE '^anupamme$' "${tmp_merged}" > "${CONTRIBUTORS_FILE}" || true
269-
elif [ -s "${tmp_logins}" ]; then
270-
cat "${tmp_logins}" > "${CONTRIBUTORS_FILE}"
271261
else
272-
echo "::notice title=No contributors found::No contributors in this range."
273-
echo "" > "${CONTRIBUTORS_FILE}"
262+
echo "::notice title=No PRs in range::No merged PRs between tags; falling back to commit authors."
263+
printf '' > "${CONTRIBUTORS_FILE}"
274264
fi
275265
- name: Generate release notes from actual commit range
276266
if: ${{ steps.release_exists.outputs.skip != 'true' }}

tools/release/changelog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function formatChangelog({ repository = '', previousTag = '', currentTag = '', c
251251
if (!contributors.length) {
252252
lines.push('- Unknown contributor');
253253
} else {
254-
lines.push(contributors.map(formatContributorCard).join('\n  \n'));
254+
lines.push(contributors.map((contributor) => formatContributorCard(contributor).replace(/\r?\n\s*/g, '')).join(' '));
255255
}
256256
return `${lines.join('\n').replace(/\n{3,}/g, '\n\n')}\n`;
257257
}

0 commit comments

Comments
 (0)