Skip to content

Switch PR Migration Notice from pull_request_target to workflow_run to eliminate approval gate#1047

Merged
A1L13N merged 2 commits into
mainfrom
copilot/update-pr-migration-notice
Mar 26, 2026
Merged

Switch PR Migration Notice from pull_request_target to workflow_run to eliminate approval gate#1047
A1L13N merged 2 commits into
mainfrom
copilot/update-pr-migration-notice

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

pull_request_target requires maintainer approval on repos with "Require approval for all outside collaborators" enabled, blocking the migration notice from auto-running on fork PRs.

Changes

  • Trigger: pull_request_target: [opened]workflow_run on ["Test"] with types: [requested]. workflow_run always executes in the base repo context with no approval requirement.
  • Job condition: Added if: github.event.workflow_run.event == 'pull_request' to ignore push-to-main and merge_group runs.
  • PR lookup: workflow_run context omits pull_requests for fork PRs, so the script now resolves the PR via pulls.list using headOwner:headBranch.
  • Permissions: Added issues: write (required by issues.createComment).
  • Resilience: try/catch around the API call; when multiple open PRs match, sorts by updated_at and picks the most recent.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update PR migration notice to not require approval Switch PR Migration Notice from pull_request_target to workflow_run to eliminate approval gate Mar 26, 2026
Copilot AI requested a review from A1L13N March 26, 2026 05:10
@A1L13N A1L13N marked this pull request as ready for review March 26, 2026 05:11
@github-actions github-actions Bot added the files-changed: 1 PR changes 1 file label Mar 26, 2026
@A1L13N A1L13N enabled auto-merge March 26, 2026 05:11
@A1L13N A1L13N disabled auto-merge March 26, 2026 07:29
@A1L13N A1L13N merged commit 7a682c2 into main Mar 26, 2026
15 checks passed
@A1L13N A1L13N deleted the copilot/update-pr-migration-notice branch March 26, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

files-changed: 1 PR changes 1 file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants