Repository navigation
Authorize policy-service bot for documentation merge checks - #69747
Conversation
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
|
Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at. |
There was a problem hiding this comment.
🔵 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.
|
✅ 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
|
Fixes problems like in https://github.com/dotnet/aspnetcore/actions/runs/37927725106:
Description
Add only
on.bots: ["dotnet-policy-service[bot]"]topr-docs-check.md, retainingon.roles: [admin, maintainer, write]. Regenerate the lock with the existing gh-aw v0.91.6 compiler; generatedGH_AW_ALLOWED_BOTScontains 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
noneand 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.cjsproducer, 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, includingtest_real_git_workspace_producer_rejects_abandoned_editsand all seven workspace cases, after supplying native Git Bash and jq 1.8.2 on PATH.steps.safe-outputs-head-app-tokenis undefined in the agent job (main line 694 → changed line 697), and actionlint does not recognizegithub.aw.import-inputs.random_seed(main line 2566 → changed line 2569). No new diagnostics. Exact invocation for each input:Here
$toolsis a session-local tool directory, and the baseline was exported withgit 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 --checkandgit 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.