martin-g commented on PR #3659:
URL: https://github.com/apache/avro/pull/3659#issuecomment-3990211101

   The labeler does not work with `on>pull_request`:
   ```
   The configuration file (path: .github/labeler.yml) was not found locally, 
fetching via the api
   Warning: The action requires write permission to add labels to pull 
requests. For more information please refer to the action documentation: 
https://github.com/actions/labeler#recommended-permissions
   Error: Resource not accessible by integration
   ```
   
   https://github.com/actions/labeler#recommended-permissions says:
   ```
   However, when the action runs on a pull request from a forked repository, 
GitHub only grants read access tokens for pull_request events, at most. If you 
encounter an Error: HttpError: Resource not accessible by integration, it's 
likely due to these permission constraints. To resolve this issue, you can 
modify the on: section of your workflow to use 
[pull_request_target](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target)
 instead of pull_request (see example 
[above](https://github.com/actions/labeler#create-workflow)). This change 
allows the action to have write access, because pull_request_target alters the 
[context of the 
action](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target)
 and safely grants additional permissions.
   
   There exists a potentially dangerous misuse of the pull_request_target 
workflow trigger that may lead to malicious PR authors (i.e. attackers) being 
able to obtain repository write permissions or stealing repository secrets. 
Hence, it is advisable that pull_request_target should only be used in 
workflows that are carefully designed to avoid executing untrusted code and to 
also ensure that workflows using pull_request_target limit access to sensitive 
resources. Refer to the [GitHub token permissions 
documentation](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)
 for more details about access levels and event contexts.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to