Skip to content

fix: add Copilot actor to bots list for agent activation#72

Merged
microsasa merged 2 commits intomainfrom
fix/copilot-bot-actor-name
Mar 15, 2026
Merged

fix: add Copilot actor to bots list for agent activation#72
microsasa merged 2 commits intomainfrom
fix/copilot-bot-actor-name

Conversation

@microsasa
Copy link
Owner

@microsasa microsasa commented Mar 15, 2026

Problem

The pull_request_review event triggered by Copilot's auto-review has context.actor = 'Copilot' (the GitHub App), but our workflow bots list only contained copilot-pull-request-reviewer (the review author login). These are different identities.

check_membership.cjs in gh-aw's pre_activation job:

  1. Checks context.actor against repo roles → fails (Copilot is not a user)
  2. Falls back to GH_AW_ALLOWED_BOTSCopilot not in [copilot-pull-request-reviewer]activation blocked

Result: pre_activation completes with success but activated output is false, so the activation and agent jobs are skipped. The agent never runs.

Fix

Add Copilot to the bots: list in both review-responder.md and quality-gate.md. Keep copilot-pull-request-reviewer as well for safety across different event types.

Evidence

From the pre_activation logs:

GH_AW_ALLOWED_BOTS: copilot-pull-request-reviewer
Checking if user 'Copilot' has required permissions for microsasa/cli-tools
⚠️ Repository permission check failed: Copilot is not a user

Closes

The pull_request_review event actor is 'Copilot' (the GitHub App),
not 'copilot-pull-request-reviewer' (the review author login).
check_membership.cjs compares context.actor against GH_AW_ALLOWED_BOTS,
so 'Copilot' must be in the list for the activation gate to pass.

Keep both identities for safety across different event types.

Closes #70

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsasa microsasa added the aw Created by agentic workflow label Mar 15, 2026
Copilot AI review requested due to automatic review settings March 15, 2026 16:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes gh-aw agent activation for Copilot-triggered pull_request_review events by allowing the GitHub App actor (Copilot) to pass the pre-activation bot allowlist, ensuring the activation and agent jobs run as intended.

Changes:

  • Add Copilot to the on.bots allowlist in review-responder.md and quality-gate.md.
  • Regenerate the corresponding compiled .lock.yml workflows so GH_AW_ALLOWED_BOTS includes Copilot.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
.github/workflows/review-responder.md Adds Copilot to the gh-aw on.bots allowlist for review responder activation.
.github/workflows/review-responder.lock.yml Updates compiled workflow to include Copilot in GH_AW_ALLOWED_BOTS.
.github/workflows/quality-gate.md Adds Copilot to the gh-aw on.bots allowlist for quality gate activation.
.github/workflows/quality-gate.lock.yml Updates compiled workflow to include Copilot in GH_AW_ALLOWED_BOTS.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes gh-aw agent workflow activation for Copilot auto-reviews by allowing the GitHub App actor (Copilot) in the permitted bots list, aligning workflow configuration with the actual pull_request_review event actor identity.

Changes:

  • Add Copilot to the bots: allowlist in review-responder.md and quality-gate.md.
  • Regenerate the compiled gh-aw workflow lockfiles so GH_AW_ALLOWED_BOTS includes Copilot alongside copilot-pull-request-reviewer.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
.github/workflows/review-responder.md Adds Copilot to the gh-aw bots allowlist for activation on pull_request_review.
.github/workflows/review-responder.lock.yml Updates compiled GH_AW_ALLOWED_BOTS and metadata to include Copilot.
.github/workflows/quality-gate.md Adds Copilot to the gh-aw bots allowlist for activation on pull_request_review.
.github/workflows/quality-gate.lock.yml Updates compiled GH_AW_ALLOWED_BOTS and metadata to include Copilot.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Document the context.actor = 'Copilot' vs review author = 'copilot-pull-request-reviewer'
distinction in agentic-workflows.md pitfalls, debugging, and history sections.
Add changelog entry for the fix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsasa microsasa merged commit 0888cf3 into main Mar 15, 2026
5 checks passed
@microsasa microsasa deleted the fix/copilot-bot-actor-name branch March 15, 2026 17:00
microsasa pushed a commit that referenced this pull request Mar 15, 2026
check_membership.cjs has a bug where the error branch from a 404
(GitHub App actors are not users) exits before the bot allowlist
fallback is evaluated. This makes the bots: field ineffective.

Workaround: roles: all skips the permission check entirely so
check_membership.cjs is not included in pre_activation.

Previous attempts that didn't fix this:
- PR #64: bots: at top level (ignored by compiler)
- PR #65: bots: under on: (correct placement, but runtime bug)
- PR #72: added Copilot to bots list (correct actor, but bot check unreachable)

Tracked for removal when upstream is fixed: #74
Upstream bug: github/gh-aw#21098

Closes #75

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aw Created by agentic workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Copilot actor name mismatch blocks agent activation

2 participants