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

Add options to specify header level and version prefix #336

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RaumZeit
Copy link

@RaumZeit RaumZeit commented Apr 2, 2024

Hi,

in our project, the CHANGELOG.md file deviates a little from what is expected by the current github actions script. In particular, the header level of the version specific changelog entries is H3 instead of H2. In addition, the header not only states the version number (x.y.z), but contains a prefix string, such that each line looks like:

[Version x.y.z]

instead of just

[x.y.z]

To account for these deviations, I've modified your script to allow for additional, optional arguments:

  • specifying the expected header level via the header_level input
  • adding (expecting) a prefix to the version string via the version_prefix input

I thought, it might be useful for others, so I want to share. The additional inputs are documented and examples are given in README.md as well.

It would be nice, if it would be integrated into your mainstream release.

Cheers,
RaumZeit

@RaumZeit RaumZeit requested a review from ffurrer2 as a code owner April 2, 2024 13:08
const start_of_release = (!!line.match("^#+ \\[[0-9]") || (prerelease === 'true' && !!line.match("^#+ \\[Unreleased\\]")))
let header_match = (!!line.match(level_match_regex))
let headerup_match = (!!line.match(levelup_match_regex))
let start_of_release = (!!line.match(level_match_regex + version_match_regex) || (prerelease === 'true' && !!line.match(level_match_regex + unreleases_match_regex)))

Check failure

Code scanning / CodeQL

Regular expression injection High

This regular expression is constructed from a
GitHub Actions user input
.
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.

None yet

1 participant