-
Notifications
You must be signed in to change notification settings - Fork 44
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
ci: add job to check PR label requirements #1189
ci: add job to check PR label requirements #1189
Conversation
dda8117
to
9111665
Compare
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.
Add a check to verify that a PR has the challenged label.
Please add require-challenge
to the required checks in the .wetf-repo.yml
file.
.github/workflows/labels.yml
Outdated
on: | ||
pull_request: | ||
branches: | ||
- '*' # Trigger on all branches for pull requests |
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.
Should this be master
?
I guess in practice it does not make a difference.
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.
Changed it to master
.github/workflows/labels.yml
Outdated
mode: exactly | ||
count: 1 | ||
labels: "challenged" | ||
add_comment: true |
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.
The GitHub Actions token won't have write access if the PR is from a fork, do you know if the action handles that gracefully?
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.
I added a permissions
section now but it looks as if the workflow still doesn't have the necessary permissions to add a comment to the PR. Looks like the same problem that you had here. Any suggestions welcome.
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.
It's just like that. PR from forks don't get write permissions. You can configure it to allow it, but only for private repos. For public repositories there would only be the way to pass in a separate token that has the required permission (but here you have the same problem because fork PRs don't have access to secrets). So it might be easiest to just not create a comment (if the action does not handle it gracefully).
The error you see right now on this PR though probably stems from trying to add a new workflow from a fork PR, which is also not allowed (I think it would usually run the version it finds in the base branch, but that does not exist). So to properly run on this PR, you would need to create the PR from a fork.
d235881
to
f10cf24
Compare
Closed in favour of #1190 |
Add a check to verify that a PR has the
challenged
label. Would need to be added to the "required checks" in the repository. Functionality can be tested with this PR in my fork.