Skip to content

Use shared Copilot PAT pool for docs workflow - #69431

Merged
DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:deaglegross-docs-workflow-pat-pool
Sep 22, 2026
Merged

DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:deaglegross-docs-workflow-pat-pool

Conversation

@DeagleGross

Copy link
Copy Markdown
Member

Summary

  • move pr-docs-check Copilot inference from the standalone COPILOT_GITHUB_TOKEN secret to ASP.NET Core's shared PAT pool
  • keep native workflow-token access limited to ordinary dotnet/aspnetcore source operations
  • preserve GitHub App authentication for dotnet/AspNetCore.Docs and dotnet/AspNetCore.Docs.Automation
  • add focused authentication assertions and regenerate the strict workflow lock

The existing single COPILOT_GITHUB_TOKEN returned HTTP 401 from /models in https://github.com/dotnet/aspnetcore/actions/runs/35660910787. The shared copilot-pat-pool is established ASP.NET Core infrastructure and avoids depending on that stale standalone repository secret. Copilot inference intentionally does not use copilot-requests: write or the workflow GITHUB_TOKEN.

Validation

  • python -m unittest discover -s .github/workflows/pr-docs-check -p "test_*.py" (25 passed)
  • gh aw compile pr-docs-check --strict --validate --approve
  • inspected .github/workflows/pr-docs-check.lock.yml for PAT-pool selection, environment propagation, token boundaries, and App repository scope
  • git diff --check

Copilot AI lite review requested due to automatic review settings September 22, 2026 08:16
@DeagleGross
DeagleGross requested review from a team and wtgodbe as code owners September 22, 2026 08:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The workflow/auth changes are consistent with the PR intent and validation, with only a minor test readability nit identified.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

This PR updates the pr-docs-check agentic workflow to obtain GitHub Copilot inference credentials from ASP.NET Core’s shared copilot-pat-pool instead of a standalone COPILOT_GITHUB_TOKEN secret, and regenerates the strict lock file accordingly.

Changes:

  • Import shared/pat_pool.md, run the workflow in the copilot-pat-pool environment, and set COPILOT_GITHUB_TOKEN via the selected PAT pool entry.
  • Add authentication-focused unit tests to assert PAT-pool usage and the absence of copilot-requests: write.
  • Regenerate pr-docs-check.lock.yml to reflect the new secrets, job dependencies, and environment wiring.
File Description
.github/​workflows/​pr-docs-check/​test_authentication.py Adds assertions ensuring Copilot inference uses the PAT pool and avoids copilot-requests: write.
.github/​workflows/​pr-docs-check.md Switches Copilot token sourcing to the shared PAT pool and configures the copilot-pat-pool environment/import.
.github/​workflows/​pr-docs-check.lock.yml Regenerated strict lock file reflecting PAT pool secrets, jobs, and environment propagation.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.



WORKFLOW = Path(__file__).parents[1] / "pr-docs-check.md"
POOL_TOKEN_EXPRESSION = "${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, 'NO COPILOT PAT AVAILABLE') }}"
@DeagleGross
DeagleGross merged commit 89ab938 into dotnet:main Sep 22, 2026
11 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 23, 2026
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.

3 participants