Skip to content

Conversation

@ddevsr
Copy link
Collaborator

@ddevsr ddevsr commented Sep 12, 2023

Description
Follow-up #7921

Move to workflows

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@ddevsr ddevsr mentioned this pull request Sep 12, 2023
5 tasks
@kenjis kenjis changed the title fix: move labeler conflict PR chore: fix move labeler conflict PR Sep 12, 2023
@kenjis kenjis added the github_actions Pull requests that update Github_actions code label Sep 12, 2023
@kenjis kenjis merged commit f35f956 into codeigniter4:develop Sep 12, 2023
@ddevsr ddevsr deleted the move-labeler-conflict branch September 12, 2023 02:04
@ddevsr
Copy link
Collaborator Author

ddevsr commented Sep 13, 2023

@kenjis Based on https://github.com/actions/labeler#permissions and https://github.com/prince-chrismc/label-merge-conflicts-action#faq---how-do-i-fix-resource-not-accessible-by-integration must using event pull_request_target

In order to add labels to pull requests, the GitHub labeler action requires write permissions on the pull-request. 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 instead of pull_request (see example above). This change allows the action to have write access, because pull_request_target alters the context of the action and safely grants additional permissions.

@paulbalandan
Copy link
Member

But using pull_request_target event is dangerous and not recommended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update Github_actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants