Skip to content

Use GITHUB_TOKEN for docs workflow source access - #69423

Merged
DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:deaglegross-docs-workflow-token-scope
Sep 21, 2026
Merged

DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:deaglegross-docs-workflow-token-scope

Conversation

@DeagleGross

Copy link
Copy Markdown
Member

Summary

Recent documentation workflow runs failed while minting the ASP.NET Core docs GitHub App token because the request included dotnet/aspnetcore, requiring the App installation to cover the source repository.

This change uses the workflow's native GITHUB_TOKEN for ASP.NET Core source reads, GitHub MCP access, and source PR comments. The docs App remains scoped to dotnet/AspNetCore.Docs, with dotnet/AspNetCore.Docs.Automation included only where branch reads or writes require it. The trusted notification job now separates source-repository and docs-repository API calls so each uses the appropriate credential.

Validation

  • python -m unittest discover -s .github\workflows\pr-docs-check -p "test_*.py" -v
  • gh aw compile pr-docs-check --strict --validate --approve
  • Inspected the generated lock file and confirmed no GitHub App token request includes aspnetcore
  • git diff --check

Use the native GITHUB_TOKEN for ASP.NET Core source reads and comments while keeping the docs GitHub App scoped to the docs repositories.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 878a3b22-439e-4665-9e1c-a0c228957f54
Copilot AI lite review requested due to automatic review settings September 21, 2026 21:31
@DeagleGross
DeagleGross requested review from a team and wtgodbe as code owners September 21, 2026 21:31

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

🟡 Changes recommended

Authentication regression tests have unresolved coverage gaps for repository values, source-step scoping, and the docs-token-prefixed git fetch.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates the docs workflow to use GITHUB_TOKEN for source-repository access while retaining the docs GitHub App for documentation repositories.

Changes:

  • Separates source and documentation repository authentication.
  • Adds source author notification handling.
  • Adds authentication regression tests and regenerates the lock file.
File Summary
.github/​workflows/​pr-docs-check/​test_authentication.py Adds authentication checks. Moderate findings: assertions do not reliably validate repository entries or target the source-resolution step.
.github/​workflows/​pr-docs-check.md Updates workflow credentials and permissions. Moderate finding: the authentication test does not cover the docs-token-prefixed git fetch.
.github/​workflows/​pr-docs-check.lock.yml Regenerated compiled workflow.

Comment on lines +23 to +25
for match in re.finditer(r"repositories:(?: \S+|\s*\n(?: {8,}\S+\n)+)", self.workflow):
repositories = match.group(0)
self.assertNotRegex(repositories, r"(?im)^\s*aspnetcore\s*$")
@DeagleGross
DeagleGross enabled auto-merge (squash) September 21, 2026 21:54
@DeagleGross
DeagleGross merged commit fd51ba6 into dotnet:main Sep 21, 2026
11 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 22, 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