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

Fix changelog checks #2642

Merged
merged 2 commits into from
Nov 8, 2024
Merged

Fix changelog checks #2642

merged 2 commits into from
Nov 8, 2024

Conversation

mexanick
Copy link
Contributor

@mexanick mexanick commented Nov 8, 2024

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.

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: |
Copy link
Member

@maxnoe maxnoe Nov 8, 2024

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"

?

Copy link
Contributor Author

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.

Copy link

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage No coverage information (94.20% Estimated after merge)
  • Duplications No duplication information (0.70% Estimated after merge)

Project ID: cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs

View in SonarQube

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') }}
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Member

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

@maxnoe maxnoe merged commit 63295fa into main Nov 8, 2024
13 checks passed
@maxnoe maxnoe deleted the changelog-checks branch November 8, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants