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

ci: fix permissions issue in label-pr workflow #77

Merged
merged 1 commit into from
Mar 4, 2024
Merged

ci: fix permissions issue in label-pr workflow #77

merged 1 commit into from
Mar 4, 2024

Conversation

wexxlee
Copy link
Collaborator

@wexxlee wexxlee commented Mar 4, 2024

Small fix for the PR labeling workflow. It appears that the job that's supposed to run when a PR review is submitted isn't removing the needs-review label because it relies on a different GH event (pull_request_review) than the other jobs (pull_request_target), and therefore doesn't auto-inherit read/write permissions on PRs. Didn't pick this up in testing because it's affected by whether the PR originates from the same repo or a fork.

This is hopefully the easy fix, but the doc on maximum token permissions seems inconsistent with the doc on the permissions attribute, so it might need a different approach if this doesn't work.

@github-actions github-actions bot added ci /.github/ needs-review Awaiting review labels Mar 4, 2024
@wexxlee wexxlee enabled auto-merge (squash) March 4, 2024 01:04
@github-actions github-actions bot added the auto-merge PR will be auto-merged upon approving review label Mar 4, 2024
@wexxlee wexxlee merged commit 60e7f18 into OverlayPlugin:main Mar 4, 2024
12 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 4, 2024
Small fix for the PR labeling workflow. It appears that the job that's
supposed to run when a PR review is submitted [isn't removing the
needs-review
label](https://github.com/OverlayPlugin/cactbot/actions/runs/8132959713/job/22223972723)
because it relies on a different GH event (`pull_request_review`) than
the other jobs (`pull_request_target`), and therefore doesn't
auto-inherit read/write permissions on PRs. Didn't pick this up in
testing because it's affected by whether the PR originates from the same
repo or a fork.

This is hopefully the easy fix, but the
[doc](https://docs.github.com/en/actions/security-guides/automatic-token-authentication)
on maximum token permissions seems inconsistent with the
[doc](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions)
on the permissions attribute, so it might need a different approach if
this doesn't work. 60e7f18
@wexxlee wexxlee removed the needs-review Awaiting review label Mar 4, 2024
@wexxlee wexxlee deleted the workflow-fix branch March 4, 2024 03:32
wexxlee added a commit that referenced this pull request Mar 10, 2024
#77 didn't quite do it, but this one should. Tested against PRs from a
forked repo, and it now works fine.

It's a little hacky in terms of a fix, but the reasons (and steps) are
explained in a comment at the top of `label-pr-review.yml`.
github-actions bot pushed a commit that referenced this pull request Mar 10, 2024
#77 didn't quite do it, but this one should. Tested against PRs from a
forked repo, and it now works fine.

It's a little hacky in terms of a fix, but the reasons (and steps) are
explained in a comment at the top of `label-pr-review.yml`. fc45243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge PR will be auto-merged upon approving review ci /.github/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants