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

skip news check if github.actor is pre-commit-ci[bot] #12614

Closed
wants to merge 4 commits into from

Conversation

shenxianpeng
Copy link
Contributor

.github/workflows/news-file.yml Outdated Show resolved Hide resolved
Co-authored-by: Pradyun Gedam <[email protected]>
@shenxianpeng shenxianpeng requested a review from pradyunsg April 10, 2024 07:10
@shenxianpeng
Copy link
Contributor Author

Now it's ready for review.

if: "!contains(github.event.pull_request.labels.*.name, 'skip news')"
if: |
!contains(github.event.pull_request.labels.*.name, 'skip news') ||
github.actor != 'pre-commit-ci[bot]'
Copy link
Member

@notatallshaw notatallshaw Dec 7, 2024

Choose a reason for hiding this comment

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

Is the logical OR here correct?

If the skip news label isn't present, the first condition in the if statement evaluates to True, if the github actor is pre-commit-ci[bot] then the second condition evaluates to False. True OR False is True, so the check will be required.

Further if the skip news label is present but the actor is not pre-commit-ci[bot], then this will be True or False which is True, and so skip news will now no longer work unless the actor is pre-commit-ci[bot].

I think the correct code here is:

if: |
  !(contains(github.event.pull_request.labels.*.name, 'skip news')) &&
  github.actor != 'pre-commit-ci[bot]'

But let me know if I missed something.

@ichard26
Copy link
Member

ichard26 commented Dec 7, 2024

Do we even need the GHA news file workflow now that we have the PSF Chronographer check? I'd imagine that it'd suffer from the same false positive, but we can ask the app's devs to add a way to address that.

@ichard26
Copy link
Member

With #13107 merged, the news entry GHA workflow is gone. This PR isn't needed anymore.

@ichard26 ichard26 closed this Dec 10, 2024
@ichard26 ichard26 added the resolution: no action When the resolution is to not do anything label Dec 10, 2024
@shenxianpeng shenxianpeng deleted the skip-news branch December 10, 2024 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided resolution: no action When the resolution is to not do anything
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants