-
Notifications
You must be signed in to change notification settings - Fork 268
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
Fix changelog checks #2642
Fix changelog checks #2642
Conversation
This comment has been minimized.
This comment has been minimized.
fail: true | ||
- name: Check for at least one changelog fragment | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-needed') }} | ||
run: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this just be:
find docs/changes -type f | grep -P "${FRAGMENT_NAME_PREFIX}/\.(feature|bugfix|api|datamodel|optimization|maintenance)\.rst"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
automatically did in pure bash, but this is indeed much neater.
files: ${{ env.FRAGMENT_NAME }} | ||
fail: true | ||
- name: Check for at least one changelog fragment | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-needed') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you absolutely sure that no space after "!" works as you want? The evaluation rules for bash are very fickle and specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. This PR has the "no-changelog-needed" label and passes the changelog check despite it has no changelog entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not bash, it is githubs expression language
Use bash script instead of file-existence-action, as that action doesn't seem to have an option "check if at least one exists"
Tested manually with local run of github-actions.
Currently add "no-changelog-needed" label, but can remove and add changelog for automated test.
Not sure if this propagate to an actual changelog though.