fix(labeler): use pull_request_target event for fork compatibility#73
Merged
fix(labeler): use pull_request_target event for fork compatibility#73
Conversation
The labeler workflow used pull_request which lacks write permissions on fork PRs due to GitHub security restrictions. Switching to pull_request_target runs the workflow in the base repo context and grants the GITHUB_TOKEN the pull-requests:write permission needed to apply labels.
026e6a9 to
11caf91
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The PR Labeler workflow failed for PR #72 because it used the
pull_requestevent trigger, which restricts token permissions for fork-based PRs to read-only. This caused the labeler action to fail with "Resource not accessible by integration" error.Solution
Changed the workflow trigger from
pull_requesttopull_request_target. This runs the workflow in the base repository context, granting proper write access to the token regardless of whether the PR originates from a fork.Changes
.github/workflows/labeler.yml: Changed event trigger frompull_requesttopull_request_targetTesting