Skip to content

Migrate Copilot PAT pool to shared workflow import#127946

Merged
jeffhandley merged 5 commits intodotnet:mainfrom
jeffhandley:jeffhandley/pat-pool-updates
May 8, 2026
Merged

Migrate Copilot PAT pool to shared workflow import#127946
jeffhandley merged 5 commits intodotnet:mainfrom
jeffhandley:jeffhandley/pat-pool-updates

Conversation

@jeffhandley
Copy link
Copy Markdown
Member

Replaces the per-workflow inline select-copilot-pat action with the shared pat_pool.md now usable with in gh-aw v0.71.5. The new pattern fixes a bug where COPILOT_PAT_0 was always selected because activation needs: did not incorporate jobs referenced in engine.env expressions (github/gh-aw#30232, fixed in v0.71.5).

Also adds a workflow that monitors the PAT pool health.

jeffhandley and others added 3 commits May 8, 2026 00:21
Replaces the per-workflow inline `select-copilot-pat` action with the
shared `pat_pool.md` now usable with in gh-aw v0.71.5. The new pattern
fixes a bug where `COPILOT_PAT_0` was always selected because activation
`needs:` did not incorporate jobs referenced in `engine.env` expressions
(github/gh-aw#30232, fixed in v0.71.5).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a daily workflow that validates each Copilot PAT in the pool by issuing a low-effort Copilot CLI request, surfacing empty/invalid/unknown PATs in the GitHub Actions step summary, and failing the run when any PAT is invalid or unverified.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jeffhandley jeffhandley requested review from ericstj and lewing May 8, 2026 07:31
@jeffhandley jeffhandley requested a review from a team as a code owner May 8, 2026 07:31
Copilot AI review requested due to automatic review settings May 8, 2026 07:31
@github-actions github-actions Bot added the area-skills Agent Skills label May 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repo’s GitHub Agentic Workflows to select Copilot authentication from a shared “PAT pool” import (instead of per-workflow inline steps / a composite action), and adds a scheduled workflow to validate the health of the PAT pool.

Changes:

  • Added a shared workflow import (shared/pat_pool.md) + documentation, and migrated agentic workflows to use needs.pat_pool.outputs.pat_number for COPILOT_GITHUB_TOKEN selection.
  • Regenerated agentic workflow lock files using gh-aw v0.71.5 and removed the old select-copilot-pat composite action.
  • Added a scheduled validate-pat-pool.yml workflow to verify each COPILOT_PAT_# secret can successfully run a minimal Copilot CLI request.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.github/workflows/validate-pat-pool.yml New scheduled/manual workflow to probe each PAT and fail loudly on invalid/unknown/empty pools.
.github/workflows/shared/pat_pool.md New shared import defining the pat_pool job that selects a random PAT slot and emits the chosen index.
.github/workflows/shared/pat_pool.README.md Usage + security guidance for integrating the PAT pool import into consuming workflows.
.github/workflows/copilot-echo.md Migrated to import shared/pat_pool.md and select token via needs.pat_pool.outputs.pat_number.
.github/workflows/code-review.md Migrated to import shared/pat_pool.md and select token via needs.pat_pool.outputs.pat_number.
.github/workflows/ci-failure-scan.md Migrated to import shared/pat_pool.md and select token via needs.pat_pool.outputs.pat_number.
.github/workflows/breaking-change-doc.md Migrated to import shared/pat_pool.md and select token via needs.pat_pool.outputs.pat_number.
.github/workflows/ci-failure-scan.lock.yml Regenerated compiled workflow output (now includes PAT pool import + updated gh-aw/AWF tooling).
.github/workflows/breaking-change-doc.lock.yml Regenerated compiled workflow output (now includes PAT pool import + updated gh-aw/AWF tooling).
.github/workflows/code-review.lock.yml Regenerated compiled workflow output (now includes PAT pool import + updated gh-aw/AWF tooling).
.github/workflows/copilot-echo.lock.yml Regenerated compiled workflow output (now includes PAT pool import + updated gh-aw/AWF tooling).
.github/mcp.json Adds MCP server configuration to run gh aw mcp-server.
.github/aw/actions-lock.json Updates the pinned action SHAs list for regenerated workflows.
.github/agents/agentic-workflows.agent.md Updates repo guidance to reflect the new PAT pool import pattern and gh-aw version.
.github/actions/select-copilot-pat/README.md Removed (obsolete after migrating to shared import).
.github/actions/select-copilot-pat/action.yml Removed (obsolete after migrating to shared import).

Comment thread .github/workflows/shared/pat_pool.md Outdated
Comment thread .github/workflows/shared/pat_pool.README.md Outdated
Comment thread .github/workflows/shared/pat_pool.README.md
Comment thread .github/workflows/validate-pat-pool.yml
Comment thread .github/workflows/validate-pat-pool.yml
@jeffhandley jeffhandley merged commit 0160e21 into dotnet:main May 8, 2026
28 checks passed
@jeffhandley jeffhandley deleted the jeffhandley/pat-pool-updates branch May 8, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-skills Agent Skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants