Skip to content

Commit

Permalink
Add the reason for the need of write permission and usage reference t…
Browse files Browse the repository at this point in the history
…o the `branch-label` action in the `github-actions` package.

Address:
- #122 (comment)
- #122 (comment)
  • Loading branch information
eason9487 committed May 9, 2024
1 parent 2e94295 commit 424eada
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/github-actions/actions/branch-label/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ jobs:
#### 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.
In order to add labels to pull requests, this action requires write permissions on the pull request. However, when the action runs on a pull request from a fork, GitHub only grants read access tokens for the `pull_request` event. Therefore, it's recommended to use the `pull_request_target` event instead of `pull_request` to avoid the issue of not having permission.

Ref:
- https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
- https://github.com/actions/labeler/tree/v5#usage
- https://github.com/actions/labeler/tree/v5#permissions

## Migration from v1 to v2:
Expand Down

0 comments on commit 424eada

Please sign in to comment.