Skip to content

fix: propagate on.github-token to checkout and hash check steps in activation job#26137

Merged
pelikhan merged 4 commits intomainfrom
copilot/fix-github-token-propagation
Apr 14, 2026
Merged

fix: propagate on.github-token to checkout and hash check steps in activation job#26137
pelikhan merged 4 commits intomainfrom
copilot/fix-github-token-propagation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

on.github-token was already wired to reaction, comment, and label removal steps, but the activation job's sparse checkout and lock file hash check steps still used the default GITHUB_TOKEN. In cross-org workflow_call scenarios this causes the checkout to fail silently and the hash check API to 404, producing a false-positive ERR_CONFIG: Lock file is outdated or unverifiable.

Changes

  • checkout_step_generator.goGenerateGitHubFolderCheckoutStep() gains a token string parameter; emits token: only when the value is non-empty and not ${{ secrets.GITHUB_TOKEN }}

  • compiler_activation_job.gogenerateCheckoutGitHubFolderForActivation() resolves the activation token via resolveActivationToken(data) and threads it into both GenerateGitHubFolderCheckoutStep() call sites

  • compiler_activation_job.go — "Check workflow lock file" step now conditionally emits github-token: using resolveActivationToken(data), consistent with the reaction/comment pattern:

    hashToken := c.resolveActivationToken(data)
    if hashToken != "${{ secrets.GITHUB_TOKEN }}" {
        steps = append(steps, fmt.Sprintf("          github-token: %s\n", hashToken))
    }
  • Tests — all existing callers updated for the new signature ("" for default token); new tests cover token emission/suppression in GenerateGitHubFolderCheckoutStep, propagation through generateCheckoutGitHubFolderForActivation, and hash check step token injection; TestActivationGitHubApp updated to expect the app token on 3 steps (reaction + comment + hash check) instead of 2

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://api.github.com/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 GO111MODULE ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git 3968720163 GO111MODULE /opt/hostedtoolc--show-toplevel 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 git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/infocmp 539324495 git ache/go/1.25.8/x--show-toplevel infocmp (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 git re-branch git rev-�� --show-toplevel docker /usr/bin/git /usr/libexec/docgit git /usr/bin/git git (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh -c "prettier" --cheGOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go /opt/hostedtoolc-test.v=true (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name ed-with-body-content.md git /usr/bin/git --show-toplevel 756004/b421/impo-test.testlogfile=/tmp/go-build3741910706/b394/testlog.txt om/owner/repo.gi-test.paniconexit0 git rev-�� --show-toplevel node /usr/bin/git /tmp/TestHashStanode /opt/hostedtoolc/tmp/js-hash-test-203205594/test-hash.js /opt/hostedtoolc/tmp/TestHashConsistency_GoAndJavaScript152455389/001/test-frontmatter-with-arrays.md git (http block)
  • https://api.github.com/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 --show-toplevel x_amd64/compile /usr/bin/gh -json GO111MODULE 64/bin/go gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts /usr/bin/git .artifacts[].namgit GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel git /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel git /usr/bin/git /opt/hostedtoolcache/node/24.14.1/x64/bin/node /tmp�� pload-artifact/git/ref/tags/v7 git /usr/bin/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha /bin/sh git /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel /bin/sh /usr/bin/git node js/f�� /opt/hostedtoolc--show-toplevel git /usr/bin/git --show-toplevel node /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha k/gh-aw/gh-aw/.github/workflows/api-consumption-report.md rev-parse ache/node/24.14.1/x64/bin/node -json GO111MODULE 64/bin/go ache/node/24.14.1/x64/bin/node -210�� /tmp/gh-aw-test-runs/20260414-013221-30329/test-1891132620/custom/workflows remote /usr/bin/git --check **/*.cjs 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha bility_SameInputSameOutput807826827/001/stability-test.md git /usr/bin/git --show-toplevel ache/go/1.25.8/xrev-parse /usr/bin/git git init�� --bare --initial-branch=main /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel git /usr/bin/git user.name Test User /usr/bin/git git rev-�� --show-toplevel git ache/node/24.14.1/x64/bin/node --get remote.origin.urrev-parse /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel go /usr/bin/git rity3559781332/0git GO111MODULE .test git rev-�� --show-toplevel .test /usr/bin/git -json GO111MODULE ache/go/1.25.8/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel Xp6OGyvU4qtQm/EvHVfoXKqPDWup4Av8v1.0.0 /usr/bin/git ry=1 GO111MODULE 1/x64/bin/node git rev-�� --show-toplevel 1/x64/bin/node /usr/bin/git k/gh-aw/gh-aw/.ggit -trimpath ache/go/1.25.8/x--show-toplevel git (http block)
  • https://api.github.com/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 --show-toplevel go /usr/bin/git 85/001/test-inlicut GO111MODULE ache/go/1.25.8/x64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE ache/go/1.25.8/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha --show-toplevel l /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git /opt/hostedtoolcache/node/24.14.1/x64/bin/node rity8657970/001 git /usr/bin/git /opt/hostedtoolcache/node/24.14.1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE b/gh-aw/pkg/parsenv GOMODCACHE go env Am6K/WBJJoxLAcTRGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 756004/b407/impoGO111MODULE (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha prettier --check 64/bin/go **/*.ts **/*.json --ignore-path go list�� -mod=readonly -f 64/bin/go -- unsafe 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha 756004/b387/embeGOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcGOPROXY -o /tmp/go-build192GOSUMDB -trimpath 64/bin/go -p github.com/githu-1 -lang=go1.25 go (http block)
  • https://api.github.com/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 github.event.inputs.branch go /usr/bin/git -json GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet 83545/b451/vet.cfg -json GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel git /usr/bin/git Gitmaster_branchgit Gitmaster_branchrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha 9161243/b001/workflow.test git 9161243/b001/importcfg.link --show-toplevel git (http block)
  • https://api.github.com/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 om/owner/repo.git go /usr/bin/git ay_c3500679909/0git GO111MODULE nch,headSha,disp--show-toplevel git rev-�� --show-toplevel x_amd64/vet /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel infocmp /opt/hostedtoolcache/node/24.14.1/x64/bin/node ature-branch.patgit git /usr/bin/git node /tmp�� /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/archie.md git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel git /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel git (http block)
  • https://api.github.com/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 83545/b432/_pkg_.a -buildtags 83545/b432=> -errorsas -ifaceassert -nilfunc git push�� YHLh/BOY-j7o0lOpHVfUmYHLh l /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel 83545/b406/constconfig /usr/bin/git git rev-�� Onlymin-integrity_with_repos_array_c4036672615/001 git /usr/bin/git --show-toplevel go /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel ache/node/24.14.1/x64/bin/node 1/x64/bin/node /usr/bin/git 64/pkg/tool/linurev-parse /usr/bin/git git arne�� --show-toplevel git 1/x64/bin/node -m Initial commit /usr/bin/git git (http block)
  • https://api.github.com/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 -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 1/x64/bin/node GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha ExpressionCompiledOutput948599882/001 GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env .a GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE ngutil GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha 3221-30329/test-2106113390 GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet env -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/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 --show-toplevel git /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel git /opt/hostedtoolc--noprofile node /opt�� install --package-lock-only /usr/bin/git 1/x64/bin/node git /opt/hostedtoolcxterm-color git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha --show-toplevel git /home/REDACTED/go/bin/node --show-toplevel git /opt/hostedtoolcs/^session\.save_path=\(.*;\)\?\(.*\)$/\2/p node /opt�� install --package-lock-only /usr/bin/git 1/x64/bin/node git /opt/hostedtoolcxterm-color git (http block)
  • https://api.github.com/repos/docker/build-push-action/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v7 --jq .object.sha --oneline -10 /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git 1/x64/bin/node --show-toplevel git /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v7 --jq .object.sha /tmp/gh-aw git $name) { hasDiscussionsEnabled } } --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git r: $owner, name:-f --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha -c go /usr/bin/git -json GO111MODULE x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha --get remote.origin.url /usr/bin/git --show-toplevel git /usr/local/bin/b--show-toplevel git rev-�� 3528-35944/test-2279085897 bash /usr/bin/git y-test.md git /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha --show-toplevel git /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel git /usr/bin/git node js/f�� /usr/bin/git git /opt/hostedtoolcache/node/24.14.1/x64/bin/node /usr/bin/git git /usr/bin/git node (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha -aw/git/ref/tags/v2.0.0 -trimpath /usr/bin/infocmp -p github.com/githurev-parse -lang=go1.25 infocmp -1 :latest -goversion /usr/bin/git -c=4 -nolocalimports -importcfg git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha 3528-35944/test-remote.origin.url git ache/node/24.14.1/x64/bin/node --show-toplevel 64/pkg/tool/linuconfig /usr/bin/git git t-40�� CompiledOutput2936266841/001 git /usr/bin/git --show-toplevel go /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel git 1/x64/bin/node --show-toplevel l ache/node/24.14.--show-toplevel git arne�� --show-toplevel ache/node/24.14.test@example.com /usr/bin/git .prop.prop.prop.git git /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha sistency_GoAndJavaScript1251998085/001/test-complex-frontmatter-with-tools.md -test.v=true ache/node/24.14.1/x64/bin/node -test.timeout=10git -test.run=^Test -test.short=true--show-toplevel infocmp t-30�� sistency_WithImports1807703041/001/main.md go /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel go /usr/bin/git git rev-�� --show-toplevel git e/git-upload-pack --show-toplevel go /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel git 1/x64/bin/node --show-toplevel git /usr/bin/git git arne�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 2106113390 GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE til.test GOINSECURE GOMOD GOMODCACHE til.test (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name remote /usr/bin/git port PATH="$(fingit git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git Gitmain_branch15git Gitmain_branch15rev-parse /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env thub/workflows GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 1386454499 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name git /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� /ref/tags/v9 git /usr/bin/git 4719340/001 4719340/002/workrev-parse /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env thub/workflows l_test.go ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 1386454499 GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name config /usr/bin/infocmp remote.origin.urgit git /usr/bin/git infocmp -1 xterm-color git /usr/bin/git Gitmain_branch15git Gitmain_branch15rev-parse /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuorigin (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env " GO111MODULE x_amd64/link GOINSECURE GOMOD GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name git At,event,headBranch,headSha,displayTitle --show-toplevel git /usr/bin/git node /tmp�� /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/ace-editor.md git /usr/bin/git 01 git /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE n-dir/bash GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name git /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git 01 git /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json go ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE 86_64/bash GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name git ache/node/24.14.1/x64/bin/node --show-toplevel git /usr/bin/git ache/node/24.14.1/x64/bin/node 0113�� uts.version git /usr/bin/git --show-toplevel node /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 2853105128 GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name git /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path -c=4 -nolocalimports -importcfg /tmp/go-build77783545/b411/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/fileutil/fileutil.go /home/REDACTED/work/gh-aw/gh-aw/pkg/fileutil/tar.go -c "prettier" --cheGOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK run-script/lib/n/tmp/go-build77783545/b414/_pkg_.a gcc (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel 64/pkg/tool/linutest@example.com /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git 348/001/stabilit/bin/sh GO111MODULE fg git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha Safe: ${{ github.actor }}, Unsafe: ${{ secrets.TOKEN }} git /usr/bin/git 827/001/stabilitgit git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel gh /usr/bin/git --paginate repos/{owner}/{rrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/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 edOutput948599882/001 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env drain.test GO111MODULE x_amd64/link GOINSECURE GOMOD GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel /usr/lib/git-core/git /usr/bin/git --objects --stdin ache/node/24.14.--show-toplevel git rev-�� --show-toplevel git /usr/bin/git k/gh-aw/gh-aw/.ggit config /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel nly /usr/bin/git --show-toplevel git /usr/bin/git /usr/bin/git conf�� --get-regexp ^remote\..*\.gh-resolved$ e/git /tmp/TestGuardPonode config /usr/bin/gh e/git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha -json GOMOD 64/bin/go tierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel git /usr/bin/head --show-toplevel go /usr/bin/git head -500�� /tmp/gh-aw/aw-feature-branch.patch git /usr/bin/git --show-toplevel go /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha log.showsignatur-errorsas log 64/bin/go -d format:pkg-json 64/bin/go go env 5350373/001 5350373/002/work 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha -x c 64/bin/go - (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha /tmp/go-build192GOSUMDB -trimpath 64/bin/go -p github.com/githu-1 -lang=go1.25 go env lGitmain_branch3965350373/001' lGitmain_branch3965350373/001' 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha --end-of-options-test.timeout=10m0s blob 64/bin/go npx prettier --winfocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha --show-toplevel infocmp /usr/bin/git xterm-color 1i/tNwzg2pK2C7y3/tmp/js-hash-test-2201136173/test-hash.js /usr/bin/git git rev-�� LsRemoteWithRealGitcustom_branch4256778555/001' LsRemoteWithRealGitcustom_branch4256778555/001' /usr/bin/git --show-toplevel go /usr/bin/git git (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/-
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/- --jq .object.sha /usr/bin/git z6fwpJUr57LC9/OkVRH2YT4o6AMK7I1Q1E/Rfsd4kMUHhPfXjlfWXrJ/CvEe1sFz6fwpJUr57LC9 /usr/bin/git ry=1 git 846111/b001/_pkg/home/REDACTED/work/gh-aw/gh-aw/.github/workflows git rev-�� --show-toplevel node /usr/bin/du 1/x64/bin/node git /opt/hostedtoolc/home/REDACTED/work/gh-aw/gh-aw/.github/workflows du (http block)
  • https://api.github.com/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 edOutput948599882/001 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel git-upload-pack /usr/bin/git -stringintconv -tests /usr/bin/git git rev-�� --show-toplevel git ache/uv/0.11.6/x86_64/node --show-toplevel sh /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel nly /usr/bin/git --show-toplevel git /usr/bin/git /usr/bin/git conf�� --get-regexp ^remote\..*\.gh-resolved$ /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion --show-toplevel git /usr/bin/git git rev-�� --show-toplevel 6GMi2c6/gPrzOOse1QvxNrqIoCVv /usr/bin/git --show-toplevel git e1c286323f6f5f84--show-toplevel git (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE 756004/b387/impoGO111MODULE -c 756004/b387/embeGOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcGOPROXY (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE 756004/b389/impoGO111MODULE -c 756004/b389/embeGOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcTest User (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo /usr/bin/git /home/REDACTED/wornode rev-parse /opt/hostedtoolc/tmp/TestHashConsistency_GoAndJavaScript152455389/001/test-empty-frontmatter.md git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile /usr/bin/git /tmp/go-build777/usr/lib/git-core/git -trimpath (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build77783545/b397/cli.test /tmp/go-build77783545/b397/cli.test -test.testlogfile=/tmp/go-build77783545/b397/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE %H %ct %D (http block)
    • Triggering command: /tmp/go-build3741910706/b370/cli.test /tmp/go-build3741910706/b370/cli.test -test.testlogfile=/tmp/go-build3741910706/b370/testlog.txt -test.paniconexit0 -test.timeout=10m0s rev-�� --show-toplevel git /usr/bin/git -m l /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git /tmp/gh-aw-test-git config /usr/bin/git git (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh -c "prettier" --cheGOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name ithub-script/git/ref/tags/v9 low.test /usr/bin/git /tmp/gh-aw-test-/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet rev-parse /opt/hostedtoolcache/node/24.14.--show-toplevel git rev-�� --show-toplevel node /usr/bin/git /tmp/TestHashCongit /opt/hostedtoolcrev-parse /usr/bin/git git (http block)

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

…tivation job

- Add token parameter to GenerateGitHubFolderCheckoutStep() and emit
  token: field when it's not the default GITHUB_TOKEN
- Pass resolveActivationToken(data) to the checkout step in
  generateCheckoutGitHubFolderForActivation()
- Add github-token: to Check workflow lock file step using
  resolveActivationToken(data)
- Update all test callers with the new token parameter
- Add tests for token propagation behavior
- Update activation_github_token_test.go to reflect that hash check
  step also uses the app token (3 uses instead of 2)

Fixes cross-org workflow_call failures where the default GITHUB_TOKEN
cannot access the callee's repository.

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/3fee77dc-cca2-4484-a576-2b9daf779b7d

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix github-token propagation in activation job for cross-org calls fix: propagate on.github-token to checkout and hash check steps in activation job Apr 14, 2026
Copilot AI requested a review from pelikhan April 14, 2026 01:45
@pelikhan pelikhan marked this pull request as ready for review April 14, 2026 01:54
Copilot AI review requested due to automatic review settings April 14, 2026 01:54
Copy link
Copy Markdown
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

This PR ensures the activation job uses the configured on.github-token (or equivalent activation token) consistently across steps that need repository/API access, avoiding silent checkout failures and false-positive stale lock-file errors in cross-org workflow_call scenarios.

Changes:

  • Extend .github/.agents sparse checkout step generation to optionally emit an explicit token: when a non-default token is provided.
  • Thread the resolved activation token through the activation job’s .github checkout generation and the lock-file hash check step.
  • Update and add tests to validate token emission/suppression and propagation; update a generated lock workflow to include the new fields.
Show a summary per file
File Description
pkg/workflow/checkout_step_generator.go Adds optional token: emission to the .github/.agents sparse checkout step generator.
pkg/workflow/compiler_activation_job.go Resolves and propagates activation token into checkout generation and hash-check step input.
pkg/workflow/compiler_activation_job_test.go Updates existing tests for the new signature and adds coverage for token propagation/emission.
pkg/workflow/checkout_manager_test.go Updates call sites for the new checkout generator signature.
pkg/workflow/activation_github_token_test.go Updates expectations to include hash-check token usage with GitHub App auth.
.github/workflows/smoke-copilot.lock.yml Updates generated lock workflow to pass token inputs for checkout and hash-check.

Copilot's findings

Tip

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

  • Files reviewed: 6/6 changed files
  • Comments generated: 1

Comment on lines +217 to +221
// Use configured github-token or app-minted token if set; omit to use default GITHUB_TOKEN.
// This is required for cross-org workflow_call where the default GITHUB_TOKEN cannot
// access the callee's repository contents via API.
hashToken := c.resolveActivationToken(data)
if hashToken != "${{ secrets.GITHUB_TOKEN }}" {
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

resolveActivationToken() can return ${{ steps.activation-app-token.outputs.token }} when data.ActivationGitHubApp is set, but the activation app token mint step is only generated when (hasReaction || hasStatusComment || shouldRemoveLabel) (see earlier in this function). With this change, the lock-file hash check may now emit with.github-token: ${{ steps.activation-app-token.outputs.token }} even when the mint step was not added, causing the workflow to reference a non-existent step ID and fail at runtime. Consider expanding the mint-step condition to include any steps that may use resolveActivationToken (e.g., stale lock-file hash check and the activation job’s sparse checkout), or adjust resolveActivationToken/the callers so the app token is only referenced when the mint step is guaranteed to exist.

Suggested change
// Use configured github-token or app-minted token if set; omit to use default GITHUB_TOKEN.
// This is required for cross-org workflow_call where the default GITHUB_TOKEN cannot
// access the callee's repository contents via API.
hashToken := c.resolveActivationToken(data)
if hashToken != "${{ secrets.GITHUB_TOKEN }}" {
// Use configured github-token when set; omit to use default GITHUB_TOKEN.
// Do not emit the activation app token step output here unless the corresponding
// mint step is guaranteed to exist in this workflow.
// This is required for cross-org workflow_call where the default GITHUB_TOKEN cannot
// access the callee's repository contents via API.
hashToken := c.resolveActivationToken(data)
if hashToken != "${{ secrets.GITHUB_TOKEN }}" && hashToken != "${{ steps.activation-app-token.outputs.token }}" {

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 90/100

Excellent test quality

Metric Value
New/modified tests analyzed 8
✅ Design tests (behavioral contracts) 8 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 8 (100%)
Duplicate test clusters 0
Test inflation detected YES (see note below)
🚨 Coding-guideline violations None

Test Classification Details

All 8 changed test functions
Test File Classification Issues Detected
TestGenerateGitHubFolderCheckoutStep_Token pkg/workflow/compiler_activation_job_test.go:626 ✅ Design None — 4-row table covers empty, default, custom PAT, and app-minted token
TestCheckoutTokenPropagatedToActivation pkg/workflow/compiler_activation_job_test.go:672 ✅ Design None — 3-row table covers custom token, missing token, and non-workflow_call trigger
TestHashCheckTokenPropagation pkg/workflow/compiler_activation_job_test.go:730 ✅ Design None — 2-row table covers custom token and missing token
TestActivationGitHubApp (modified) pkg/workflow/activation_github_token_test.go:172 ✅ Design Assertion count updated 2→3 to cover the newly propagated hash-check step
TestCrossRepoTargetRepo (sig update) pkg/workflow/checkout_manager_test.go:940 ✅ Design Signature-only update (new token param passed as ""); existing behavioral assertions unchanged
TestCrossRepoTargetRef (sig update) pkg/workflow/checkout_manager_test.go:973 ✅ Design Signature-only update; existing assertions unchanged
TestGenerateGitHubFolderCheckoutStep (sig update) pkg/workflow/compiler_activation_job_test.go:198 ✅ Design Signature-only update to table-driven test
TestGenerateGitHubFolderCheckoutStep_ExtraPaths (sig update) pkg/workflow/compiler_activation_job_test.go:619 ✅ Design Signature-only update

Flagged Tests — Requires Review

No tests require remediation. All new and modified tests are behavioral design tests.


Test Inflation Note

compiler_activation_job_test.go added 174 lines against 10 production lines added in compiler_activation_job.go — a 17.4:1 ratio that technically exceeds the 2:1 threshold and triggers the inflation penalty (−10 pts). However, this is the expected pattern for a targeted bug fix: the fix itself is a small delta (adding token propagation in a few call sites) while the tests comprehensively verify the new behaviour, including multiple edge cases (empty token, default GITHUB_TOKEN, custom PAT, app-minted token). The test quality here is genuinely high — the inflation metric is a false positive in this context.


Language Support

Tests analyzed:

  • 🐹 Go (*_test.go): 8 tests — all unit (//go:build !integration)
  • 🟨 JavaScript (*.test.cjs, *.test.js): 0 tests

Verdict

Check passed. 0% of new tests are implementation tests (threshold: 30%). All new tests verify observable behavioral contracts with appropriate edge-case coverage. No mock-library violations or missing build tags detected.


📖 Understanding Test Classifications

Design Tests (High Value) verify what the system does:

  • Assert on observable outputs, return values, or state changes
  • Cover error paths and boundary conditions
  • Would catch a behavioral regression if deleted
  • Remain valid even after internal refactoring

Implementation Tests (Low Value) verify how the system does it:

  • Assert on internal function calls (mocking internals)
  • Only test the happy path with typical inputs
  • Break during legitimate refactoring even when behavior is correct
  • Give false assurance: they pass even when the system is wrong

Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators.

🧪 Test quality analysis by Test Quality Sentinel · ● 619.7K ·

Copy link
Copy Markdown
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.

✅ Test Quality Sentinel: 90/100. Test quality is excellent — 0% of new tests are implementation tests (threshold: 30%). All 3 new test functions are table-driven design tests covering the key behavioral contract: on.github-token propagation to checkout and hash-check steps, with thorough edge cases (empty token, default GITHUB_TOKEN, custom PAT, app-minted token). No coding-guideline violations detected.

…tion checkout and hash steps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Commit pushed: 705ca01

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions
Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (>100 new lines in pkg/workflow/) but does not have a linked Architecture Decision Record (ADR).

AI has analyzed the PR diff and generated a draft ADR to help you get started:

📄 Draft ADR: docs/adr/26137-propagate-github-token-to-activation-checkout-and-hash-steps.md

The draft captures the key design decisions in this fix:

  • Adding a token parameter to GenerateGitHubFolderCheckoutStep() (breaking API change)
  • The convention that empty string and $\{\{ secrets.GITHUB_TOKEN }} both suppress token emission
  • Consistent propagation of resolveActivationToken(data) to checkout and hash check steps

What to do next

  1. Review the draft ADR committed to your branch — it was generated from the PR diff
  2. Complete the missing sections — add context the AI couldn't infer, refine the decision rationale, and list real alternatives you considered
  3. Commit the finalized ADR to docs/adr/ on your branch
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-26137: Propagate on.github-token to Activation Checkout and Hash Check Steps

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

Why ADRs Matter

"AI made me procrastinate on key design decisions. Because refactoring was cheap, I could always say 'I'll deal with this later.' Deferring decisions corroded my ability to think clearly."

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.


📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number (e.g., 26137-propagate-github-token-to-activation-checkout-and-hash-steps.md for PR #26137).

🔒 This PR cannot merge until an ADR is linked in the PR body.

Note

🔒 Integrity filter blocked 1 item

The following item were blocked because they don't meet the GitHub integrity level.

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · ● 157.1K ·

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot Review all comments

When ActivationGitHubApp is set but no reaction/comment/label step is
configured, the mint step was not generated — but the hash check step
still emitted github-token: ${{ steps.activation-app-token.outputs.token }},
causing a runtime reference to a non-existent step ID.

Fix: introduce needsAppTokenForRepoAccess flag (true when an app is
configured and stale-check is enabled) and include it in the mint
condition. Also adds contents:read to the app permissions when the
token is needed for repo access.

Adds regression test: app_token_minted_for_hash_check_even_without_reaction_or_comment

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/4305e874-b9da-426f-ad5b-20f433049f62

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

Copilot AI commented Apr 14, 2026

@copilot Review all comments

Addressed in 53fa484. The reviewer's concern was valid: when ActivationGitHubApp is configured but no reaction/comment/label step exists, the mint step wasn't generated — but the hash check step would still emit github-token: ${{ steps.activation-app-token.outputs.token }}, referencing a non-existent step.

The fix introduces a needsAppTokenForRepoAccess flag (true when a GitHub App is configured and stale-check is enabled) and includes it in the mint condition, so the token is always minted before any step that references it. contents:read is also added to the app permissions when minting for repo access. A regression test (app_token_minted_for_hash_check_even_without_reaction_or_comment) covers this exact scenario.

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://api.github.com/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 (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 GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE node (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 GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh (http block)
  • https://api.github.com/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 -bool 4109163/b001/_testmain.go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link -errorsas -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link -V=f�� -stringintconv -tests /usr/bin/git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha get --local ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet copilot.originalgit (http block)
  • https://api.github.com/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 --show-toplevel -tests /usr/bin/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel x_amd64/vet /usr/bin/git (http block)
  • https://api.github.com/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 --show-toplevel (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha -unreachable=false /tmp/go-build3714109163/b038/vet.cfg 4109163/b335/vet.cfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha t0 m0s /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha -unreachable=false /tmp/go-build3714109163/b067/vet.cfg /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/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 6678486/b001/workflow.test /tmp/go-build3714109163/b057/vet.cfg 6678486/b001/importcfg.link (http block)
  • https://api.github.com/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 -unreachable=false /tmp/go-build3714109163/b068/vet.cfg 4109163/b355/vet.cfg (http block)
  • https://api.github.com/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 --get-regexp .cfg 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/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 GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE b/gh-aw/pkg/fileenv GOMODCACHE go env MFpD/H8VUAZrsjt5GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 5631393/b400/impGO111MODULE (http block)
  • https://api.github.com/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 TwbH/eYixQu9LFAaGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 5631393/b428/impGOPROXY /hom�� che/go-build/23/GOSUMDB **/*.cjs 64/bin/go **/*.json --ignore-path ../../../.prettixterm-color go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE node /hom�� --check **/*.cjs 64/bin/go **/*.json --ignore-path ../../../.prettixterm-color go (http block)
  • https://api.github.com/repos/docker/build-push-action/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v7 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v7 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env to pkg/workflow/data/action_pins.json...&#34; GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha -unreachable=false /tmp/go-build3714109163/b004/vet.cfg 4109163/b345/vet.cfg (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha --local .cfg 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha --local --get 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel (http block)
  • https://api.github.com/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)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/-
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/- --jq .object.sha GOPATH sh 64/bin/go tierignore git 64/bin/go go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/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)

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

@pelikhan pelikhan merged commit 4120765 into main Apr 14, 2026
@pelikhan pelikhan deleted the copilot/fix-github-token-propagation branch April 14, 2026 03:38
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.

on.github-token not propagated to checkout and hash check steps in activation job (breaks cross-org workflow_call)

3 participants