Skip to content

Fix documentation workflow output handling - #69435

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

DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:deaglegross-fix-docs-workflow-output

Conversation

@DeagleGross

Copy link
Copy Markdown
Member

Fixes two failures observed in workflow run 35706277858.

The safe-output preflight validator used a single elif chain for drafted outcomes. A valid docs_pr_action: created with exactly one create_pull_request made the error predicate false, then fell through to the final rejection. This change validates created and updated in explicit branches and adds positive preflight coverage for both paths while retaining the existing negative cases.

The custom Notify source PR job attempted to comment on the merged source PR with issues: write but only pull-requests: read, which produced 403 Resource not accessible by integration. The job now grants both issues: write and pull-requests: write and continues to use the native ${{ github.token }} for the source-repository comment.

The Copilot PAT pool remains inference-only. Pool PATs have only Copilot Requests (Read), so they are not used for source comments or any repository mutation. Tests enforce that the pool expression is confined to the engine configuration. The existing authentication split is preserved: the native workflow token handles ordinary dotnet/aspnetcore operations, while the docs GitHub App remains limited to AspNetCore.Docs and AspNetCore.Docs.Automation.

Validation:

  • python -m unittest discover -s .github/workflows/pr-docs-check -p "test_*.py" (28 passed)
  • gh aw compile pr-docs-check --strict --validate --approve
  • git diff --check

Copilot AI lite review requested due to automatic review settings September 22, 2026 09:15
@DeagleGross
DeagleGross requested review from a team and wtgodbe as code owners September 22, 2026 09:15
@DeagleGross DeagleGross self-assigned this Sep 22, 2026
@DeagleGross DeagleGross added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Sep 22, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

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 changes are small, targeted to the described workflow failures, and include additional unit coverage for the corrected preflight paths.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Updates the pr-docs-check workflow’s “safe-output” validation and source-PR notification permissions to address two observed workflow failures, and adds/extends unit tests to prevent regressions.

Changes:

  • Fixes validate_preflight drafted-outcome handling by validating docs_pr_action: created and updated in explicit branches.
  • Adds positive preflight tests for both created and updated drafted paths.
  • Updates the “Notify source PR” job permissions (and corresponding docs/lock output) to allow the workflow to write back to the source PR as intended.
File Description
.github/​workflows/​pr-docs-check/​validate_outcome.py Corrects preflight branching so valid drafted created / updated outcomes are accepted and validated appropriately.
.github/​workflows/​pr-docs-check/​test_validate_outcome.py Adds coverage ensuring preflight accepts valid drafted create/update scenarios.
.github/​workflows/​pr-docs-check/​test_authentication.py Extends authentication/permissions assertions for inference-only PAT pool usage and source notification job behavior.
.github/​workflows/​pr-docs-check.md Updates workflow definition to grant pull-requests: write for “Notify source PR”.
.github/​workflows/​pr-docs-check.lock.yml Regenerates compiled workflow output reflecting the updated permissions.

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

@DeagleGross
DeagleGross merged commit fa516e5 into dotnet:main Sep 22, 2026
19 of 20 checks passed
@DeagleGross
DeagleGross deleted the deaglegross-fix-docs-workflow-output branch September 22, 2026 10:59
@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

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants