Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

The PR triage workflow fails for pull requests from forks because pull_request runs in the fork's context without write permissions to add labels.

Changes

.github/workflows/issue-triage.yml

  • Changed trigger from pull_request to pull_request_target
  • Updated event name check in issue_number calculation

.github/workflows/reusable-issue-triage.yml

  • Updated job condition and environment variable logic to handle pull_request_target event

Context

pull_request_target runs in the base repository's context, providing access to secrets and write permissions while still receiving the PR's metadata via github.event.pull_request. The existing permissions block (issues: write, pull-requests: write) now applies correctly for fork PRs.

Original prompt

This section details on the original issue you should resolve

<issue_title>PR triage for forks</issue_title>
<issue_description>I think the PR triage workflow needs to use pull_request_target so it works for PRs originating from forks.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Update PR triage workflow for forks Use pull_request_target for PR triage to support forks Jan 6, 2026
Copilot AI requested a review from swissspidy January 6, 2026 13:00
@swissspidy swissspidy marked this pull request as ready for review January 6, 2026 13:11
@swissspidy swissspidy requested a review from a team as a code owner January 6, 2026 13:11
@swissspidy swissspidy merged commit ff2458b into main Jan 6, 2026
11 checks passed
@swissspidy swissspidy deleted the copilot/update-pr-triage-workflow branch January 6, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request scope:meta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR triage for forks

2 participants