Skip to content

Add configuration for activation GitHub token#19427

Merged
pelikhan merged 7 commits intomainfrom
copilot/configure-github-token-activation
Mar 4, 2026
Merged

Add configuration for activation GitHub token#19427
pelikhan merged 7 commits intomainfrom
copilot/configure-github-token-activation

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

Adds support for configuring a custom GitHub token or GitHub App in the on: section of workflow frontmatter. The token is used in the activation job for both reactions and status comments.

New fields

on:
  github-token: ${{ secrets.MY_TOKEN }}   # use a custom PAT for reactions/comments
  # OR
  github-app:
    app-id: ${{ vars.APP_ID }}            # mint a short-lived app token instead
    private-key: ${{ secrets.APP_KEY }}

Changes

  • Schema (main_workflow_schema.json): added github-token (string) and github-app (object with app-id, private-key, owner, repositories) to the on: object
  • Extraction (role_checks.go): extractActivationGitHubToken / extractActivationGitHubApp pull the new fields from the on: map; wired into the orchestrator alongside extractRoles/extractBots
  • Reaction step moved to activation job (compiler_activation_job.go): the reaction step is now in the activation job alongside the status comment step, so both use the same configured token. A single Generate GitHub App token for activation step (id: activation-app-token) is minted once before both steps when on.github-app is set.
  • Pre-activation job simplified (compiler_pre_activation_job.go): removed the reaction step and the issues/pull-requests/discussions: write permissions that were there solely for reactions
  • Token resolution (safe_outputs_app.go): buildActivationAppTokenMintStep and resolveActivationToken encapsulate token-minting and resolution logic (app token → custom token → GITHUB_TOKEN)
  • YAML generation (compiler_safe_outputs.go, frontmatter_extraction_yaml.go): github-token and github-app are filtered/commented out from the emitted on: block, matching the treatment of reaction, stop-after, etc.
  • smoke-copilot (.github/workflows/smoke-copilot.md): added github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} to exercise the new feature end-to-end; the compiled lock file now uses this token for both the reaction and status-comment steps in the activation job

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.


Add configuration for activation GitHub token

Adds support for configuring a custom GitHub token or GitHub App in the on: section of workflow frontmatter. The token is used in the activation job for both reactions and status comments.

New fields

on:
  github-token: $\{\{ secrets.MY_TOKEN }}   # use a custom PAT for reactions/comments
  # OR
  github-app:
    app-id: $\{\{ vars.APP_ID }}            # mint a short-lived app token instead
    private-key: $\{\{ secrets.APP_KEY }}

Changes

  • Schema (main_workflow_schema.json): added github-token (string) and github-app (object with app-id, private-key, owner, repositories) to the on: object
  • Extraction (role_checks.go): extractActivationGitHubToken / extractActivationGitHubApp pull the new fields from the on: map; wired into the orchestrator alongside extractRoles/extractBots
  • Reaction step moved to activation job (compiler_activation_job.go): the reaction step is now in the activation job alongside the status comment step, so both use the same configured token. A single Generate GitHub App token for activation step (id: activation-app-token) is minted once before both steps when on.github-app is set.
  • Pre-activation job simplified (compiler_pre_activation_job.go): removed the reaction step and the issues/pull-requests/discussions: write permissions that were there solely for reactions
  • Token resolution (safe_outputs_app.go): buildActivationAppTokenMintStep and resolveActivationToken encapsulate token-minting and resolution logic (app token → custom token → GITHUB_TOKEN)
  • YAML generation (compiler_safe_outputs.go, frontmatter_extraction_yaml.go): github-token and github-app are filtered/commented out from the emitted on: block, matching the treatment of reaction, stop-after, etc.
  • smoke-copilot (.github/workflows/smoke-copilot.md): added github-token: $\{\{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} to exercise the new feature end-to-end; the compiled lock file now uses this token for both the reaction and status-comment steps in the activation job

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.]((gh.io/redacted)

Changeset

  • Type: patch
  • Description: Allow workflows to configure the activation job's GitHub token or GitHub App so reactions and status comments reuse the same credentials defined in on:.

Generated by Changeset Generator for issue #19427 ·

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.



✨ PR Review Safe Output Test - Run 22653237386

💥 [THE END] — Illustrated by Smoke Claude ·

…s and status comments

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

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilot move the add reaction step and the add status comment step into the activation step so that it uses the token. Update the pre-activation/activation permissions accordingly

…ithub-app

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

Copilot AI commented Mar 3, 2026

@copilot move the add reaction step and the add status comment step into the activation step so that it uses the token. Update the pre-activation/activation permissions accordingly

Done in f55d268. The reaction step is now in the activation job alongside the status comment step. Key changes:

  • Removed reaction step and its write permissions (issues/pull-requests/discussions: write) from the pre-activation job
  • Added reaction step early in the activation job (right after setup/checkout, before the timestamp check)
  • A single app token mint step (id: activation-app-token) is now generated once in the activation job if on.github-app is configured and either reaction or status-comment is enabled — both steps share the same token

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://v-api-github-com.286600.xyz/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw main -lang=go1.25 git rev-�� --show-toplevel -dwarf=false /usr/bin/git go1.25.0 -c=4 -nolocalimports git (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw x_amd64/vet /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw github.com/githu/tmp/gh-aw/aw-feature-branch.patch -lang=go1.25 git rev-�� --show-toplevel -goversion /usr/bin/git -c=4 -nolocalimports -importcfg git (http block)
  • https://v-api-github-com.286600.xyz/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel TH&#34;; [ -n &#34;$GOROOT&#34; ] &amp;&amp; export /usr/bin/git --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha e/git git /opt/hostedtoolcache/node/24.13.1/x64/bin/node --show-toplevel e/git /usr/bin/git node js/f�� /git/ref/tags/v8 git /opt/hostedtoolcache/uv/0.10.7/x86_64/bash --show-toplevel git /usr/bin/git bash (http block)
  • https://v-api-github-com.286600.xyz/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel /opt/hostedtoolc--jq 1/x64/bin/node -unreachable=falgit /tmp/go-build249rev-parse /opt/hostedtoolc--show-toplevel git js --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git -bool -buildtags /usr/bin/gcc git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha kflow.test bash de/node/bin/bash --noprofile git /usr/bin/git b_X62NaPAWuT-uQjzc/RT9S_AZSgK49qhEX-7Ss/xj8RnZbI-test.timeout=10m0s _har�� --show-toplevel git 08f493349a337975f0e73b4194ec4fa7dd27d91c8f195f81c8fe2eab331977fb-d --show-toplevel git /usr/bin/git git (http block)
  • https://v-api-github-com.286600.xyz/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -unreachable=false /tmp/go-build2493562985/b188/vet.cfg /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel (http block)
  • https://v-api-github-com.286600.xyz/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha se 3562985/b190/vet.cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha se 3562985/b195/vet.cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel (http block)
  • https://v-api-github-com.286600.xyz/repos/actions/download-artifact/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha --show-toplevel git /usr/bin/git get --local ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git se 3562985/b078/vetrev-parse ache/go/1.25.0/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git se 3562985/b164/vetrev-parse ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git --noprofile (http block)
  • https://v-api-github-com.286600.xyz/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha se 3562985/b192/vet.cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha se 3562985/b198/vet.cfg 08f493349a337975f0e73b4194ec4fa7dd27d91c8f195f81c8fe2eab331977fb-d (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha --show-toplevel (http block)
  • https://v-api-github-com.286600.xyz/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha se 3562985/b193/vet.cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel git ache/node/24.13.1/x64/bin/node --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel git cal/bin/bash --show-toplevel git /usr/bin/git node js/f�� /usr/bin/git git ache/go/1.25.0/x64/pkg/tool/linux_amd64/asm --show-toplevel git (http block)
  • https://v-api-github-com.286600.xyz/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha se 3562985/b187/vet.cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel git ache/node/24.13.1/x64/bin/node --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel git k/_temp/ghcca-node/node/bin/bash --show-toplevel git /usr/bin/git node js/f�� /usr/bin/git git ache/go/1.25.0/x64/bin/go --show-toplevel git /usr/bin/git node (http block)
  • https://v-api-github-com.286600.xyz/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet 1/x64/bin/node -unreachable=falgit /tmp/go-build249rev-parse 3562985/b282/vet--show-toplevel sed ance�� (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel node 1/x64/bin/node x_amd64/vet git /opt/hostedtoolc--show-toplevel git cjs --show-toplevel node ache/node/24.13.1/x64/bin/node x_amd64/vet git /usr/bin/git git (http block)
  • https://v-api-github-com.286600.xyz/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha rt/yaml/yaml_def-errorsas (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha ctivation^{commit} (http block)
  • https://v-api-github-com.286600.xyz/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha b136a0101c461533GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD erignore ache/go/1.25.0/xGO111MODULE env 8558327/b418/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://v-api-github-com.286600.xyz/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD erignore go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://v-api-github-com.286600.xyz/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel /opt/hostedtoolc--norc 1/x64/bin/node git rev-�� --show-toplevel git /usr/bin/git --show-toplevel /opt/hostedtoolc--norc /usr/bin/git git (http block)
  • https://v-api-github-com.286600.xyz/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha 8558327/b369/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/tmp GOMODCACHE go env f-GF/qbxfFo4g7fPGOSUMDB GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 8558327/b369/imp-f (http block)
  • https://v-api-github-com.286600.xyz/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel /opt/hostedtoolc--norc 1/x64/bin/node git rev-�� --show-toplevel git /usr/bin/git --show-toplevel /opt/hostedtoolc--norc /usr/bin/git git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add configuration for activation GitHub token Add configuration for activation GitHub token Mar 3, 2026
@pelikhan
Copy link
Contributor

pelikhan commented Mar 3, 2026

@copilot enable status-comment on smoke-copilot

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

Copilot AI commented Mar 3, 2026

@copilot enable status-comment on smoke-copilot

Done in 0e5f738. Added github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} to the on: section of smoke-copilot.md. The compiled lock file now uses that token for both the reaction step and the add-comment (status-comment) step in the activation job.

@pelikhan pelikhan added the smoke label Mar 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.53.0
jq 1.7
yq 4.52.4
curl 8.5.0
gh 2.87.3
node 20.20.0
python3 3.12.3
go 1.24.13
java 21.0.10 (Temurin)
dotnet 10.0.102

Result: 12/12 tools available ✅

Overall Status: PASS

🔧 Tool validation by Agent Container Smoke Test ·

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Commit pushed: 31fa88c

Generated by Changeset Generator

@github-actions github-actions bot removed the smoke label Mar 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Smoke Test Results (run §22653237411)

Test
GitHub MCP
Safe Inputs GH CLI
Serena MCP ❌ (unavailable)
Playwright
Web Fetch
File Writing
Bash Tool
Discussion Interaction
Build
Discussion Creation
Workflow Dispatch
PR Review

Overall: ⚠️ PARTIAL PASS@pelikhan, @Copilot

📰 BREAKING: Report filed by Smoke Copilot ·

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Smoke test code review for PR #19427. The reaction step relocation to the activation job is a clean improvement — it consolidates token usage and simplifies the pre-activation job permissions. The resolveActivationToken priority chain is well-structured. Minor suggestion: add a runtime debug log in resolveActivationToken to ease future troubleshooting.

📰 BREAKING: Report filed by Smoke Copilot

sparse-checkout-cone-mode: true
fetch-depth: 1
persist-credentials: false
- name: Add eyes reaction for immediate feedback
Copy link
Contributor

Choose a reason for hiding this comment

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

The reaction step has been moved here from the pre-activation job, which is a good improvement — it now fires earlier in the workflow execution before heavy activation checks, giving users faster visual feedback on their issues/PRs.

return "${{ steps.activation-app-token.outputs.token }}"
}
if data.ActivationGitHubToken != "" {
return data.ActivationGitHubToken
Copy link
Contributor

Choose a reason for hiding this comment

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

The resolveActivationToken priority chain (App token → custom token → GITHUB_TOKEN) is clean. The comment clarifying that callers must ensure buildActivationAppTokenMintStep was called first is helpful — consider also adding a runtime assertion or debug log to catch misconfiguration early.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@pelikhan
Copy link
Contributor

pelikhan commented Mar 4, 2026

@copilot do a deep code review of the updates make sure all looks good

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Smoke Test Results — Run §22653237386

Overall: PARTIAL (2 skipped, all others ✅)

Test Result
1 GitHub MCP (merged PRs)
2 GH CLI (pr list)
3 Serena MCP (activate + find_symbol)
4 Make build
5 Playwright (github.com)
6 Tavily search
7 File writing
8 Bash tool
9 Discussion interaction
10 Agentic Workflows MCP
11 Update PR body
12 PR review comments (2)
13 Submit PR review
14 Resolve review thread ⚠️ skipped
15 Add reviewer (copilot)
16 Push to PR branch
17 Close PR ⚠️ skipped

💥 [THE END] — Illustrated by Smoke Claude ·

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

💥 Automated smoke test review - all systems nominal!

💥 [THE END] — Illustrated by Smoke Claude

Copy link
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot do a deep code review of the updates make sure all looks good

Deep review complete — all tests pass, lint is clean, no CodeQL findings.

Key findings:

  • Token priority chain (resolveActivationToken): App token → custom token → GITHUB_TOKEN is correct
  • Single mint: activation-app-token step is generated exactly once when github-app is set, shared by both reaction and status-comment steps ✅
  • YAML filter: github-token / github-app are filtered from the on: events block and commented out in the generated YAML, consistent with reaction, stop-after, etc. ✅
  • Permissions: Write permissions (issues/pull-requests/discussions: write) are correctly added to the activation job when reaction or status-comment is configured, and removed from pre-activation ✅
  • Schema: github-app has additionalProperties: false, required: ["app-id", "private-key"]
  • Tests: 23 unit + compilation tests cover custom token, default token, app token, single mint, and extraction from frontmatter ✅

One intentional asymmetry worth noting: the reaction step always emits github-token: explicitly (preserving the pattern from pre-activation), while the status-comment step omits it when using the default GITHUB_TOKEN (preserving backward compat for existing workflows). Both are functionally equivalent.

@pelikhan pelikhan marked this pull request as ready for review March 4, 2026 03:26
Copilot AI review requested due to automatic review settings March 4, 2026 03:26
@pelikhan pelikhan merged commit f03bfa1 into main Mar 4, 2026
50 checks passed
@pelikhan pelikhan deleted the copilot/configure-github-token-activation branch March 4, 2026 03:26
Copy link
Contributor

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

Adds support for configuring a dedicated GitHub credential (custom token or GitHub App) for the activation job so both reactions and status comments use the same auth, and moves the reaction step into the activation job.

Changes:

  • Added on.github-token and on.github-app to the workflow schema and frontmatter extraction, wiring them into compilation.
  • Moved the reaction step (and related permissions) from pre-activation to activation; added activation-token resolution + optional GitHub App token minting.
  • Updated YAML emission to comment/filter the new on: fields, and refreshed lockfiles/tests to reflect the new job structure.

Reviewed changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pkg/workflow/task_and_reaction_permissions_test.go Updates permission/reaction assertions to reflect reaction now living in activation job
pkg/workflow/safe_outputs_app.go Adds activation token mint step builder + token resolution helper
pkg/workflow/role_checks.go Extracts on.github-token / on.github-app into workflow data
pkg/workflow/reaction_none_test.go Updates reaction/permission expectations for activation vs pre-activation jobs
pkg/workflow/frontmatter_extraction_yaml.go Comments out github-token / github-app (including nested fields) in emitted on: YAML
pkg/workflow/compiler_types.go Adds workflow data fields for activation GitHub token/app config
pkg/workflow/compiler_safe_outputs.go Filters github-token / github-app out of “other events” when regenerating on:
pkg/workflow/compiler_pre_activation_job.go Removes reaction step and reaction-related permissions from pre-activation job
pkg/workflow/compiler_orchestrator_workflow.go Wires activation token/app extraction into orchestrator configuration extraction
pkg/workflow/compiler_activation_jobs_test.go Updates tests to assert reaction removed from pre-activation and present in activation
pkg/workflow/compiler_activation_job.go Adds app-token minting + reaction step to activation job; ensures permissions cover reaction/comments
pkg/workflow/activation_github_token_test.go New unit/integration-style tests for extraction + compilation behavior of activation token/app
pkg/parser/schemas/main_workflow_schema.json Adds schema for on.github-token and on.github-app fields
.github/workflows/workflow-generator.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/unbloat-docs.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/tidy.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/smoke-update-cross-repo-pr.lock.yml Regenerated lockfile reflecting activation job permission needs
.github/workflows/smoke-test-tools.lock.yml Regenerated lockfile reflecting activation job permission needs
.github/workflows/smoke-temporary-id.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/smoke-project.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/smoke-multi-pr.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/smoke-gemini.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/smoke-create-cross-repo-pr.lock.yml Regenerated lockfile reflecting activation job permission needs
.github/workflows/smoke-copilot.md Adds on.github-token to exercise new feature end-to-end
.github/workflows/smoke-copilot.lock.yml Regenerated lockfile showing configured token used for both reaction and status comment
.github/workflows/smoke-copilot-arm.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/smoke-codex.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/smoke-claude.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/smoke-agent.lock.yml Regenerated lockfile reflecting activation job permission needs
.github/workflows/security-review.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/scout.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/q.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/pr-nitpick-reviewer.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/poem-bot.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/plan.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/pdf-summary.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/mergefest.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/grumpy-reviewer.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/craft.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/cloclo.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/changeset.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/brave.lock.yml Regenerated lockfile reflecting reaction now in activation job
.github/workflows/archie.lock.yml Regenerated lockfile reflecting reaction now in activation job
.changeset/patch-activation-github-token-config.md Adds changeset entry documenting the patch feature
Comments suppressed due to low confidence (1)

pkg/parser/schemas/main_workflow_schema.json:1456

  • Schema docs for on.github-token still say it is used for “pre-activation reactions”, but reactions were moved into the activation job in this PR. Update the description to avoid misleading users about where the token is used.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +1458 to +1461
"github-app": {
"type": "object",
"description": "GitHub App configuration for minting a token used in pre-activation reactions and activation status comments. When configured, a GitHub App installation access token is minted and used instead of the default GITHUB_TOKEN.",
"properties": {
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

Schema docs for on.github-app mention “pre-activation reactions”, but reactions now run in the activation job. Adjust the description so it reflects the current behavior and doesn’t imply a pre-activation job dependency.

This issue also appears on line 1453 of the same file.

Copilot uses AI. Check for mistakes.
Comment on lines +634 to +636
// extractActivationGitHubToken extracts the 'github-token' field from the 'on:' section of frontmatter.
// This token is used for pre-activation reactions and activation status comments.
func (c *Compiler) extractActivationGitHubToken(frontmatter map[string]any) string {
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The comment on extractActivationGitHubToken says the token is used for “pre-activation reactions”, but reactions are now emitted in the activation job. Update the comment to match the current job placement (activation reactions + activation status comments).

Copilot uses AI. Check for mistakes.
Comment on lines +275 to +277
// buildActivationAppTokenMintStep generates the step to mint a GitHub App installation access token
// for use in the pre-activation (reaction) and activation (status comment) jobs.
func (c *Compiler) buildActivationAppTokenMintStep(app *GitHubAppConfig, permissions *Permissions) []string {
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

buildActivationAppTokenMintStep comment says the minted token is used in “pre-activation (reaction) and activation (status comment) jobs”, but reactions are now generated in the activation job. Update the comment so it matches current behavior and avoids implying the pre-activation job uses this token.

Copilot uses AI. Check for mistakes.
Comment on lines +295 to +297
// Default to current repository
steps = append(steps, " repositories: ${{ github.event.repository.name }}\n")

Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

buildActivationAppTokenMintStep always sets repositories to the current repository (${{ github.event.repository.name }}), ignoring app.Repositories parsed from on.github-app.repositories. This makes the new repositories field in the schema ineffective (and prevents repositories: ['*'] org-wide installs). Consider reusing the repository-selection logic from buildGitHubAppTokenMintStep (single repo, multi repo block scalar, * => omit field, default current repo).

Copilot uses AI. Check for mistakes.
Comment on lines +276 to +282
// Check if we're entering github-app object
if !inPullRequest && !inIssues && !inDiscussion && !inIssueComment && !inGitHubApp {
// Check both uncommented and commented forms
if (strings.HasPrefix(trimmedLine, "github-app:") && trimmedLine == "github-app:") ||
(strings.HasPrefix(trimmedLine, "# github-app:") && strings.Contains(trimmedLine, "pre-activation job")) {
inGitHubApp = true
}
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The inGitHubApp detection for an already-commented # github-app: line is keyed on strings.Contains(..., "pre-activation job"), but the comment reason added for github-app mentions “activation” (and users may also comment github-app themselves). This prevents nested app-id / private-key / etc lines from being commented out when the parent is already commented, leaving confusing partially-commented YAML. Detect # github-app: regardless of the comment text (or match the new comment reason).

Copilot uses AI. Check for mistakes.
github-actions bot pushed a commit that referenced this pull request Mar 4, 2026
Documents the new `on.github-token` and `on.github-app` fields added in
#19427 that allow configuring a custom GitHub token or GitHub App for
the activation job's reactions and status comments.

- frontmatter.md: mention the two new on: fields in the Trigger Events section
- triggers.md: add dedicated "Activation Token" reference section with examples
- frontmatter-full.md: add github-token and github-app entries to the on: block

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants