Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not mention non-PR commits in release descriptions #732

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,22 @@ for commit in $(git log --pretty=%H $latest_tag..origin/main --reverse); do
summary="$(git show -s --format=%s $commit)"
echo "Found commit ${commit:0:10}: $summary"

# Parse PR number, if any
if [[ $summary =~ \(\#([0-9]+)\)$ ]]; then
pr_number=${BASH_REMATCH[1]}
if curl -s -H "$auth_header" https://api.github.com/repos/Akuli/jou/pulls/$pr_number | jq -r '.labels[].name' | grep -q '^skip-release$'; then
echo " Skipping because pull request #$pr_number has the 'skip-release' label"
continue
fi
link=https://github.com/Akuli/jou/pull/$pr_number
else
echo " No associated pull request, the commit has probably been pushed directly to main"
link=https://github.com/Akuli/jou/commit/$commit
# Parse PR number
if ! [[ $summary =~ \(\#([0-9]+)\)$ ]]; then
echo " Skipping because commit is not associated with a pull request."
continue
fi
pr_number=${BASH_REMATCH[1]}

if curl -s -H "$auth_header" https://api.github.com/repos/Akuli/jou/pulls/$pr_number | jq -r '.labels[].name' | grep -q '^skip-release$'; then
echo " Skipping because pull request #$pr_number has the 'skip-release' label"
continue
fi

if ! [ -f desc.md ]; then
echo "This release contains the following changes:" > desc.md
fi
echo "- [$summary]($link)" >> desc.md
echo "- [$summary](https://github.com/Akuli/jou/pull/$pr_number)" >> desc.md
done

if ! [ -f desc.md ]; then
Expand Down
Loading