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

Update workflow to support standard format CHANGELOG files #1529

Merged
merged 1 commit into from
Dec 16, 2024
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
10 changes: 7 additions & 3 deletions .github/workflows/autorelease-rubygem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ jobs:

find . -type f \( -iname "version.rb" -o -iname "*.gemspec" \) -exec sed -i "0,/$curr_ver/s//${next_ver}/" {} \;

printf "# %s\n\n* Update dependencies\n\n" "$next_ver" > NEW_CHANGELOG.md
cat CHANGELOG.md >> NEW_CHANGELOG.md
mv NEW_CHANGELOG.md CHANGELOG.md
if [[ $(head -n1 CHANGELOG.md) == "# Changelog" ]]; then
sed -i "s/# Changelog/# Changelog\n\n## $next_ver\n\n* Update dependencies/" CHANGELOG.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: regex

Does the asterisk need escaping given this is regex?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe it does if in the replacement part of the regex (after the second /).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that makes sense!

else
printf "# %s\n\n* Update dependencies\n\n" "$next_ver" > NEW_CHANGELOG.md
cat CHANGELOG.md >> NEW_CHANGELOG.md
mv NEW_CHANGELOG.md CHANGELOG.md
fi

git config --global user.name "GOV.UK Continuous Integration User"
git config --global user.email "[email protected]"
Expand Down