1
0
mirror of https://github.com/regclient/regclient.git synced 2025-04-18 22:44:00 +03:00

Include contributor list in releases

Signed-off-by: Brandon Mitchell <git@bmitch.net>
This commit is contained in:
Brandon Mitchell 2023-10-06 13:14:09 -04:00
parent e019ea8680
commit 559623e811
No known key found for this signature in database
GPG Key ID: 6E0FF28C767A8BEE

16
.github/release.sh vendored
View File

@ -41,6 +41,7 @@ generate_changelog() {
echo "# Release ${1}\n\nChanges:\n"
hashes="$(git log --reverse --merges --format="%h" "${prev_tag}..HEAD")"
prs=""
users=""
for hash in ${hashes}; do
subj="$(git show --format=%s ${hash})"
pr="${subj#Merge pull request #}"
@ -52,10 +53,17 @@ generate_changelog() {
echo "$msg"
prs="${prs} ${pr}"
fi
users="${users}\n$(get_pr_user "${pr}")"
# msg="$(git show --format=%b ${hash})"
# echo "- $msg ([PR ${pr}][pr-${pr}])"
fi
done
echo "\nContributors:\n"
for user in $(echo "$users" | sort -u); do
if [ -n "$user" ]; then
echo "- @${user}"
fi
done
echo
for pr in ${prs}; do
echo "[pr-${pr}]: https://github.com/${gh_repo}/pull/${pr}"
@ -78,6 +86,14 @@ get_pr_changelog() {
| sed -e 's/^- //' -e 's/^/- /' -e 's/\r//' -e "s/\$/ ([PR ${1}][pr-${1}])/"
}
get_pr_user() {
curl -sL ${gh_auth:+-H "${gh_auth}"} \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${gh_repo}/pulls/${1}" \
| jq -r .user.login
}
# prompt with last tag, asking for next tag, defaulting to patch update
if [ -z "$prev_tag" ]; then
prev_tag="$(git tag -l | tail -1)"