From 424eada2c2806c5635d1467e2fa494e9ba2a992c Mon Sep 17 00:00:00 2001 From: Eason Su Date: Thu, 9 May 2024 15:36:35 +0800 Subject: [PATCH] Add the reason for the need of write permission and usage reference to the `branch-label` action in the `github-actions` package. Address: - https://github.com/woocommerce/grow/pull/122#discussion_r1580960288 - https://github.com/woocommerce/grow/pull/122#discussion_r1580968559 --- packages/github-actions/actions/branch-label/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/github-actions/actions/branch-label/README.md b/packages/github-actions/actions/branch-label/README.md index 95c214fa..cb7f985c 100644 --- a/packages/github-actions/actions/branch-label/README.md +++ b/packages/github-actions/actions/branch-label/README.md @@ -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: