Skip to content

Authorize policy-service bot for documentation merge checks - #69747

Merged
DeagleGross merged 1 commit into
mainfrom
deaglegross-docs-merge-actor-authorization
Oct 13, 2026
Merged

DeagleGross merged 1 commit into
mainfrom
deaglegross-docs-merge-actor-authorization

Conversation

@DeagleGross

@DeagleGross DeagleGross commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Fixes problems like in https://github.com/dotnet/aspnetcore/actions/runs/37927725106:

Access denied: User 'dotnet-policy-service[bot]' is not authorized. Required permissions: admin, maintainer, write. To allow this user to run the workflow, add their role to the frontmatter. Example: roles: [admin, maintainer, write, none]

Description

Add only on.bots: ["dotnet-policy-service[bot]"] to pr-docs-check.md, retaining on.roles: [admin, maintainer, write]. Regenerate the lock with the existing gh-aw v0.91.6 compiler; generated GH_AW_ALLOWED_BOTS contains only that identity. The upstream-repository, closed, merged, main-only gate, permissions, manual skip/refresh behavior, prompt, classification, and publication scopes are unchanged. No other workflows are changed.

Production runs 37927725106 and 37927715143 concluded successfully, but the policy-service actor's membership check returned permission none and the docs context, agent, detection, publication, and notification jobs were skipped. Human-actor run 37925556678 completed the full path. The bot is the merger, not a documentation-needs classifier; allowing it to activate the existing analysis does not mean its merged changes require documentation.

The new fixture fetches the immutable v0.91.6 setup action used by this lock and executes its actual check_membership.cjs producer, mocking only the Actions context/core and GitHub permission API. It proves rejection without the allowlist and admission of the active policy bot with the generated allowlist, while preserving rejection of an unauthorized human, unlisted bots, and an inactive allowlisted bot, plus admission of existing human roles. The runtime treats the exact [bot] login and equivalent App slug as the same identity; the workflow explicitly uses the reported [bot] login.

Validation

  • gh aw version — v0.91.6.
  • gh aw compile pr-docs-check --strict --no-check-update — passed, 1 workflow succeeded, 0 compiler warnings. Existing informational notices about newer artifact-action tags were also present on main; no pins were upgraded.
  • node .github\workflows\pr-docs-check\test_actor_authorization.cjs — before the change, the missing-allowlist and bot-admission assertions failed as expected; after regeneration, all 11 producer fixtures passed, no skips.
  • python -B .github\workflows\pr-docs-check\test_rerun.py -v — all 13 passed, including test_real_git_workspace_producer_rejects_abandoned_edits and all seven workspace cases, after supplying native Git Bash and jq 1.8.2 on PATH.
  • Full docs helper suite using the established Python/Node script-discovery convention — all 11 scripts passed, 122 tests total, no skips:
$tests = Get-ChildItem .github\workflows\pr-docs-check -File | Where-Object { $_.Name -match '^test_.*\.(py|cjs)$' }
foreach ($test in $tests) {
    if ($test.Extension -eq '.py') { python -B $test.FullName } else { node $test.FullName }
    if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
  • Native actionlint v1.7.12 comparison, with shellcheck/pyflakes disabled and compiler-supported extension ignores — both main and this change exit 1 with the same two existing expression diagnostics; message, kind, and column match exactly. steps.safe-outputs-head-app-token is undefined in the agent job (main line 694 → changed line 697), and actionlint does not recognize github.aw.import-inputs.random_seed (main line 2566 → changed line 2569). No new diagnostics. Exact invocation for each input:
$options = @('-shellcheck', '', '-pyflakes', '', '-format', '{{json .}}', '-ignore', 'unknown permission scope "copilot-requests"', '-ignore', 'unexpected key "queue" for "concurrency" section', '-ignore', 'property "workflow_(repository|sha|ref|file_path)" is not defined in object type')
& "$tools\actionlint.exe" @options "$tools\pr-docs-check-baseline.lock.yml"
& "$tools\actionlint.exe" @options .github\workflows\pr-docs-check.lock.yml

Here $tools is a session-local tool directory, and the baseline was exported with git show origin/main:.github/workflows/pr-docs-check.lock.yml. The gh-aw Docker-based actionlint wrapper was unavailable locally; the native comparison above is the fallback. Standalone shellcheck was unavailable and was not run.

  • git diff --check and git diff --cached --check — passed.

Live automatic bot delivery remains pending after merge. No workflow dispatch, rerun, inference, or documentation/source mutations were performed during validation; this is local real-producer evidence with mocked API responses, not end-to-end runtime proof.

No linked issue was provided; this fixes the reported production actor-authorization failure.

Allow only dotnet-policy-service[bot] alongside the existing human roles. Regenerate with gh-aw v0.91.6 and exercise the pinned membership producer with mocked repository permissions.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 0aa20103-bba4-48a9-beb4-7c86c9c55bec
Copilot AI balanced review requested due to automatic review settings October 9, 2026 15:01
@DeagleGross
DeagleGross requested review from a team and wtgodbe as code owners October 9, 2026 15:01
@DeagleGross DeagleGross added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Oct 9, 2026
@DeagleGross DeagleGross self-assigned this Oct 9, 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.

🔵 Needs a closer look

The implementation appears consistent, but expanding access to a credentialed pull_request_target workflow warrants final human validation of the bot’s trust boundary.

0 open findings

What changed in this PR

Authorizes the policy-service merge bot to activate the existing documentation-analysis workflow while preserving current role and merge gates.

Changes:

  • Adds the exact bot identity to the workflow allowlist and regenerates the lock.
  • Adds authorization and generated-wiring coverage for bots and human roles.
File Description
.github/​workflows/​pr-docs-check.md Adds the bot allowlist entry.
.github/​workflows/​pr-docs-check.lock.yml Regenerates the compiled workflow.
.github/​workflows/​pr-docs-check/​test_actor_authorization.cjs Tests the pinned authorization producer.
.github/​workflows/​pr-docs-check/​test_runtime_wiring.py Verifies generated authorization wiring.

🧠 Review effort: Balanced


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

@DeagleGross
DeagleGross enabled auto-merge (squash) October 9, 2026 15:08
@DeagleGross
DeagleGross disabled auto-merge October 13, 2026 16:01
@DeagleGross
DeagleGross merged commit c3ee839 into main Oct 13, 2026
23 checks passed
@DeagleGross
DeagleGross deleted the deaglegross-docs-merge-actor-authorization branch October 13, 2026 16:01
@github-actions

Copy link
Copy Markdown
Contributor

✅ No documentation PR was created.

Confidence that documentation is needed: 2%

No docs needed: the PR only changes CI/repo automation (pr-docs-check workflow, lock file, tests).

Documentation surfaces considered

  • Conceptual article: Not required — Changes limited to repository automation workflow files and tests; no user-facing behavior.
  • Migration guidance: Not required — No upgrade action for users.
  • Breaking change: Not required — No compatibility impact; workflow automation only.

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — eab81d44 Deployed Oct 13, 2026 by DeagleGross via conclusion #30
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