Skip to content

fix(labeler): use pull_request_target event for fork compatibility#73

Merged
bug-ops merged 1 commit intomainfrom
fix/labeler-config-missing
Mar 19, 2026
Merged

fix(labeler): use pull_request_target event for fork compatibility#73
bug-ops merged 1 commit intomainfrom
fix/labeler-config-missing

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 19, 2026

Problem

The PR Labeler workflow failed for PR #72 because it used the pull_request event 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_request to pull_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 from pull_request to pull_request_target

Testing

  • All local checks pass: format, clippy, tests
  • No breaking changes

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.
@bug-ops bug-ops force-pushed the fix/labeler-config-missing branch from 026e6a9 to 11caf91 Compare March 19, 2026 23:04
@bug-ops bug-ops enabled auto-merge (squash) March 19, 2026 23:04
@bug-ops bug-ops merged commit bf32bf1 into main Mar 19, 2026
16 checks passed
@bug-ops bug-ops deleted the fix/labeler-config-missing branch March 19, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant