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

Conversation

brucebolt
Copy link
Member

At the moment, the gem autorelease workflow only supports CHANGELOG fles that have version numbers with h1 level headings.

Whilst this format is used in most GOV.UK gems, there are some that have been updated to use the more standard format with a single h1 and then h2 level headings for each version.

This latter format meets accessibility standards by only having a single h1 on the page and appears to be a community standard.

Therefore updating the gem autorelease workflow to support both types of file.

At the moment, the gem autorelease workflow only supports `CHANGELOG`
fles that have version numbers with h1 level headings.

Whilst this format is used in most GOV.UK gems, there are some that have
been updated to use the more standard format with a single h1 and then
h2 level headings for each version.

This latter format meets accessibility standards by only having a single
h1 on the page and appears to be a community standard [1].

Therefore updating the gem autorelease workflow to support both types of
file.

1: https://keepachangelog.com/en/1.1.0/
@brucebolt brucebolt marked this pull request as ready for review November 22, 2024 12:22
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!

@theseanything
Copy link
Contributor

@brucebolt Does this PR need a further review?

@brucebolt
Copy link
Member Author

@brucebolt Does this PR need a further review?

Yes please

@brucebolt brucebolt merged commit 1e7a246 into main Dec 16, 2024
1 check passed
@brucebolt brucebolt deleted the support-new-changelog branch December 16, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants