Skip to content

Allow allow-listed GitHub Apps to check out same-repository PRs after comment triggers - #67247

Merged
pelikhan merged 10 commits into
mainfrom
copilot/checkout-pr-branch-bot-permission-fix
Oct 10, 2026
Merged

pelikhan merged 10 commits into
mainfrom
copilot/checkout-pr-branch-bot-permission-fix

Conversation

Copilot AI commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

A GitHub App listed in on.bots can activate a comment-triggered workflow, but PR checkout rejects it because Apps are not repository collaborators.

  • Checkout authorization: Pass on.bots to the checkout step. For issue_comment and pull_request_review_comment, bypass the collaborator check only when the allow-listed Bot authored the comment and the PR head and base repository IDs match the workflow repository.
  • Safety boundary: Fork PRs, unlisted bots, mismatched authors, and other actors retain the collaborator permission check. Add focused regression coverage and document the behavior.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix checkout PR branch refuses GitHub Apps listed in on.bots Allow allow-listed GitHub Apps to check out same-repository PRs after comment triggers Oct 9, 2026
Copilot AI requested a review from pelikhan October 9, 2026 17:43
@pelikhan
pelikhan marked this pull request as ready for review October 9, 2026 18:41
Copilot AI balanced review requested due to automatic review settings October 9, 2026 18:41

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.

🟡 Changes recommended

Exact actor comparisons break the supported equivalence between App slugs and their [bot] identities.

1 open finding
What changed in this PR

Enables allowlisted GitHub Apps to check out same-repository PR branches after comment-triggered workflows.

Changes:

  • Passes on.bots into the checkout step.
  • Adds guarded bot authorization and regression tests.
  • Documents the checkout policy.
File Description
actions/​setup/​js/​checkout_pr_branch.cjs Adds allowlisted-bot checkout authorization.
actions/​setup/​js/​checkout_pr_branch.test.cjs Tests allowed and denied scenarios.
pkg/​workflow/​pr.go Emits the bot allowlist environment variable.
pkg/​workflow/​pr_test.go Tests allowlist emission.
docs/​src/​content/​docs/​reference/​triggers.md Documents the authorization boundary.

🧠 Review effort: Balanced

Comment thread actions/setup/js/checkout_pr_branch.cjs Outdated
Comment on lines +316 to +317
context.payload.sender?.login === actor &&
context.payload.comment?.user?.login === actor &&

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 7232560. Sender and comment-author logins must still match exactly; their identity is now compared canonically to the runtime actor using the existing slug/[bot] helper. Regression tests cover both forms for both comment events, mismatched actors, and differing sender/author login forms. All 243 checkout/permission tests pass.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/checkout_pr_branch.cjs:317): This exact comparison defeats the supported <slug>/<slug>[bot] equivalence when context.actor uses the plain App slug but the webhook's sender/comment logins use the bot form. check_permissions_utils.cjs:178-190 explicitly notes that GitHub Apps can appear in either form depending on event context, so an otherwise allowlisted same-repository App would still fall through to the collaborator check and be rejected. Keep sender and comment author equal to each other, then compare that identity to the runtime actor canonically. - Allow allow-listed GitHub Apps to check out same-repository PRs after comment triggers #67247 (comment)
  3. Fix failing check Compile queue phases (FAILURE): https://github.com/github/gh-aw/actions/runs/37968089041/job/113970967002.
  4. Fix failing check impacted-go-tests (FAILURE): https://github.com/github/gh-aw/actions/runs/37968089049/job/113971148497.
  5. Fix failing check JS Tests (shard 4/4) (FAILURE): https://github.com/github/gh-aw/actions/runs/37968088976/job/113971150561.
  6. Fix failing check lint-go-custom (FAILURE): https://github.com/github/gh-aw/actions/runs/37968089049/job/113971148518.
  7. Fix failing check verify-integration-build (FAILURE): https://github.com/github/gh-aw/actions/runs/37968089049/job/113971148424.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: 2b19291
Sous-chef work: 31f7e812d45f0792093269b7b90445aa9803225a204ec130694b9ceb0227d7cc 41c633c50467b0f2dc87116833139ebf287e1ad59f1a015d8d1dfedd9d1b23f1 42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac 57b160f058c0cf0ae8470606e768b98956d9e31df7d52cc35017efdeeaeffab1 cabafb2817b103330ac0d1e2e098f214c40c4ca2be128895a8b14391f7e3306f fa522b2e21098307804037628c5a26caf89f2fd1aad62ecb641f0ce15c8af84b
Sous-chef state: 3608c84d378f4c5e5584664987eaceeb2c1dbb7ead2bb681aadfc57134d8547c

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 7.09 AIC · ⌖ 7.65 AIC · ⊞ 1K · ◷
Comment /souschef to run again

Copilot AI and others added 3 commits October 9, 2026 19:17
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…ranch-bot-permission-fix

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

Merged main with make merge-main (9a031a3) and pushed the identity fix plus all five CI failure fixes in 7232560. Local make lint, final progress gate, full workflow/workqueue Go tests, JS shard 4 (4,240 tests), queue compilation phases, and integration build pass. Replied to the listed review thread; marking it resolved requires manual action because no thread-resolution mutation is available here. Fallback code review found no significant issues; CodeQL timed out. CI on the new HEAD remains unverified; no CI was triggered.

Copilot AI requested a review from gh-aw-bot October 9, 2026 19:45
@pelikhan

pelikhan commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

@copilot do a DevOps secops review, update compiler threat specs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot do a DevOps secops review, update compiler threat specs

Updated the compiler threat spec/changelog and aligned RS-05a plus its unit-test/Z3 evidence. The security review found no vulnerabilities; focused tests, the final progress gate, and all modeled Z3 queries pass. Commit: dab80d3. This was a targeted RS-05a revalidation; the full architecture revalidation remains outstanding.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: dab80d3
Sous-chef work:
Sous-chef state: c40425b081548b402e6fc2c00aa9fc1767337dde07f56cd840844d9054381591

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 4.56 AIC · ⌖ 6.99 AIC · ⊞ 1K · ◷
Comment /souschef to run again

…ranch-bot-permission-fix

# Conflicts:
#	pkg/workflow/agy_engine_test.go
#	pkg/workqueue/replay.go

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

Merged latest main via make merge-main, resolving the conflicts and preserving both sides’ changes. Merge commit 2de5633 is pushed; local validation passed. CI was not triggered.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: 2de5633
Sous-chef work:
Sous-chef state: b62af16ae3287e1fc805dceb9e49d14227c8d040637cab1b48f296800976e9e8

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 4.24 AIC · ⌖ 7.41 AIC · ⊞ 1K · ◷
Comment /souschef to run again

…ranch-bot-permission-fix

# Conflicts:
#	actions/setup/js/work_queue_issues_checks.cjs
#	pkg/workflow/agy_engine_test.go

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@pelikhan

pelikhan commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

Merged the latest main with make merge-main and resolved the two conflicts while preserving the branch changes. Merge commit 26b04e7 is pushed. Build, recompilation, lint, the final validation gate, and the queue integration test passed; the full JS suite has three failures in tests unchanged from main. CI was not triggered.

Copilot AI commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

The merge conflicts are resolved in merge commit 26b04e7, which is pushed. The branch is clean and has no active merge state; GitHub reports the PR as blocked while a check is still in progress.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: 26b04e7
Sous-chef work:
Sous-chef state: d501cfb6f1cc2f6d30604f2b95e1c636b94bac2307f515b4dc5090a2ecd67f0d

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 4.26 AIC · ⌖ 7.98 AIC · ⊞ 1K · ◷
Comment /souschef to run again

…ranch-bot-permission-fix

# Conflicts:
#	actions/setup/js/work_queue_compaction.test.cjs

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

Merged latest main (3ea471b3) with make merge-main and resolved the duplicate Vitest import conflict, preserving the existing fixes. Merge commit 862d6b5e is pushed. Build, lint, workflow recompilation, final impacted-test gate, queue compilation phases, integration-tag build, and JS shard 4 (4,281 tests) pass. Fallback review found no significant issues; CodeQL timed out. CI was not triggered. The previously answered review thread remains unresolved because thread-resolution tooling is unavailable here.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot add conformance tests, update TLA+ specs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot add conformance tests, update TLA+ specs

Added the comment-checkout conformance matrix for both event types and the TLA+ policy model with six guard-bypass negative controls. The baseline and all negative controls passed. Commit: 9aeca60.

@pelikhan
pelikhan merged commit 0ad7d36 into main Oct 10, 2026
48 checks passed
@pelikhan
pelikhan deleted the copilot/checkout-pr-branch-bot-permission-fix branch October 10, 2026 01:02
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.

Checkout PR branch refuses GitHub Apps listed in on.bots for comment-triggered workflows

4 participants