-
Notifications
You must be signed in to change notification settings - Fork 7
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
Upgrade the branch-label
action to use Node.js v20
#122
Upgrade the branch-label
action to use Node.js v20
#122
Conversation
…use Node.js v20.
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.
Thanks @eason9487 for working on this! I tested creating some PRs in a fork branch and it worked well, so LGTM 👍 I left some comments but they are not blockers.
|
||
#### Permissions: | ||
|
||
It's recommended to use the `pull_request_target` event instead of `pull_request` to avoid the issue of not having permission to add labels to 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.
In this action, we're not directly interacting with the code from the PR, so we're OK. However, shouldn't we also mention here that pull_request_target
will grant access to secrets for PRs from forks?
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.
Thanks for the suggestion. Added in 424eada.
|
||
Ref: | ||
- https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target | ||
- https://github.com/actions/labeler/tree/v5#permissions |
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.
As we are using the labeler action, I think this link can be useful too: https://github.com/actions/labeler?tab=readme-ov-file#usage
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.
Added in 424eada.
…o the `branch-label` action in the `github-actions` package. Address: - #122 (comment) - #122 (comment)
Changes proposed in this Pull Request:
Part of #108
This PR upgrades the
branch-label
action to use Node.js v20.actions-ecosystem/action-add-labels
action has not been updated for almost 4 years. Therefore, this PR changes to use an alternativeactions/labeler
action to achieve the same function.pull_request_target
instead ofpull_request
.Detailed test instructions:
📌 Using Node.js v20
📌 View testing PRs to see if the alternative implementation can achieve the same results
1️⃣ Add a label: eason9487#24
2️⃣ Add multiple labels: eason9487#25
3️⃣ Mismatched branch name: eason9487#26
No labels are added because the branch name
fixed/space-time-rift
didn't match any rules.4️⃣ No required permissions: eason9487#29
This test explains that a workflow uses
pull_request
event may result in permission issue when a PR is created from forks.