Skip to content

fix: propagate per-handler staged: true to JS safe output handlers#18961

Merged
pelikhan merged 2 commits intomainfrom
copilot/debug-smoke-claude-failure-another-one
Mar 1, 2026
Merged

fix: propagate per-handler staged: true to JS safe output handlers#18961
pelikhan merged 2 commits intomainfrom
copilot/debug-smoke-claude-failure-another-one

Conversation

Copy link
Contributor

Copilot AI commented Mar 1, 2026

Per-handler staged: true config (e.g. push-to-pull-request-branch: staged: true) was silently ignored — the flag was never parsed from the config map nor included in the GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG JSON, so handlers always fell through to live GitHub/git operations. This caused the Smoke Claude failure when the agent attempted a real git fetch for a PR branch.

Changes

  • safe_outputs_config.goparseBaseSafeOutputConfig now parses the staged field into BaseSafeOutputConfig.Staged (the struct field already existed but was never populated)
  • compiler_safe_outputs_config.go — Added AddIfTrue(key, bool) helper to handlerConfigBuilder; wired staged into the push_to_pull_request_branch and close_pull_request handler config builders
  • push_to_pull_request_branch.cjs / close_pull_request.cjsisStaged now checks both the global env var and the per-handler config:
    const isStaged = process.env.GH_AW_SAFE_OUTPUTS_STAGED === "true" || config.staged === true;
  • compiler_safe_outputs_config_test.go — Added table-driven tests asserting "staged": true appears in the compiled handler config JSON
  • Lock files — Recompiled; smoke-claude.lock.yml GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG now includes "staged":true for both affected handlers

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 apply-force ings.cjs forks.js add feature.txt git 64/bin/git user.email test@example.com/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/safe_outputs_mcp_server.cjs cal/bin/git 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 apply-force ings.cjs forks.js add feature.txt git de/node/bin/git user.email test@example.com/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/safe_outputs_mcp_server.cjs ode-gyp-bin/git 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 apply-force ings.cjs forks.js add feature.txt git de . git /git 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 GOMODCACHE ache/go/1.25.0/xGO111MODULE ache/node/24.13.1/x64/bin/node 9567878/b382/_pkgit GO111MODULE 64/bin/go ache/node/24.13.1/x64/bin/node 1251�� y -trimpath /usr/bin/git -p github.com/githurev-parse -lang=go1.25 git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel /tmp/go-build408rev-parse /usr/bin/gh git rev-�� --show-toplevel gh /usr/bin/git list --json /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 3504-30414/test-4008810316 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 1/x64/bin/node GOINSECURE GOMOD GOMODCACHE 1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel git /usr/bin/infocmp runs/20260301-01git config /usr/bin/git infocmp -1 xterm-color 2732769/b424/importcfg /usr/bin/git k/gh-aw/gh-aw/pkgit l /usr/bin/gh 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 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -aw/git/ref/tags/v1.0.0 test@example.com /usr/bin/git --check **/*.cjs 64/bin/go git init�� ../../../.pretti/tmp/gh-aw-test-runs/20260301-013504-30414/test-197845902/custom/workflows node /opt/hostedtoolcache/node/24.13.1/x64/bin/node ub/workflows scripts/**/*.js 64/bin/go node (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 -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --local user.email 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha .version=f1c2d64-dirty" -o gh-aw--include=*_test.go user.name 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --local user.name 64/pkg/tool/linux_amd64/vet (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 --local user.email 64/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 --local user.name (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha --local user.name 64/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 o actions/setup-cli/install.sh..." user.email 64/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 --get-regexp ^remote\..*\.gh-resolved$ /usr/bin/git -json GO111MODULE 64/bin/go git -C /home/REDACTED/work/gh-aw/gh-aw/.github/workflows rev-parse ache/node/24.13.1/x64/bin/node -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 /tmp/gh-aw-test-git status /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --git-dir go /opt/hostedtoolc--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 json ]; then \ cp .github/aw/actions-lock.json pkg/workflow/data/action_pins.json; \ echo "���git user.email 64/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 runs/20260301-013504-30414/test-4008810316 go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel erignore ache/node/24.13.1/x64/bin/node ript formatting git 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 git /usr/bin/git --git-dir node /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel go /opt/hostedtoolc--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 ingutil.test GO111MODULE ortcfg.link GOINSECURE GOMOD GOMODCACHE IRvpGBR5doDzA4AFK5/V9GO631eEkrOy3AfQMRN/iHVJYL1nWTZV4o_JT9qh env itattributes-test1439057656/.github/workflows/test.md itattributes-test1439057656/.github/workflows/test.lock.yml g_.a GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel go /usr/bin/git -json l /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel GOPROXY /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 git /usr/bin/git --show-toplevel git /usr/bin/git git conf�� user.name Test User x_amd64/link --show-toplevel git /usr/bin/git x_amd64/link (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go estl�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 git x_amd64/compile --show-toplevel git /usr/bin/git x_amd64/compile rev-�� --show-toplevel git 1/x64/bin/node --show-toplevel infocmp /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go estl�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 git x_amd64/vet --show-toplevel git /usr/bin/git x_amd64/vet rev-�� --show-toplevel git 1/x64/bin/node --show-toplevel gh /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 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 run download 2 --dir test-logs/run-2 git /usr/bin/git --show-toplevel git /usr/bin/git git conf�� user.email test@example.com 1/x64/bin/node --show-toplevel /usr/bin/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 run download 3 --dir test-logs/run-3 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 run download 3 --dir test-logs/run-3 --jq /usr/bin/git --show-toplevel git /usr/bin/git git add initial.txt git x_amd64/compile --show-toplevel gh /usr/bin/git x_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 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 run download 4 --dir test-logs/run-4 git /usr/bin/git --show-toplevel git /usr/bin/git git comm�� -m Initial commit x_amd64/link --show-toplevel /opt/hostedtoolcrev-parse /usr/bin/git x_amd64/link (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/link GOINSECURE GOMOD GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 git /usr/lib/git-core/git --show-toplevel git /usr/bin/git /usr/lib/git-core/git main�� hub/workflows --auto 1/x64/bin/node --detach infocmp /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 GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go m/_n�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 %H %ct %D 678031f8c9ce9411--noprofile go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh (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 x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md
    • Triggering command: /opt/hostedtoolcache/node/24.13.1/x64/bin/node /opt/hostedtoolcache/node/24.13.1/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js m ode_modules/.bin--verify git push�� -u origin ache/node/24.13.1/x64/bin/git Eer8W git run-script/lib/node-gyp-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 -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 3419167711/.github/workflows GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE .cfg git (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 -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/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE .cfg 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 x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion --show-toplevel git /usr/bin/git x_amd64/link -l /usr/bin/git git 1/x64/bin/node --show-toplevel /usr/bin/git DiscussionsEnabl--show-toplevel Hn/9SjWRb46lV6QqGDTFKYD/NmhKkqxN2HuEx506oada (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 erignore env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo /usr/bin/git --show-toplevel go /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel /tmp/go-build408js/fuzz_sanitize_output_harness.cjs /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo /usr/bin/git --show-toplevel go /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/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build4082732769/b380/cli.test /tmp/go-build4082732769/b380/cli.test -test.testlogfile=/tmp/go-build4082732769/b380/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE go k/gh�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD erignore go (http block)
    • Triggering command: /tmp/go-build4200860481/b001/cli.test /tmp/go-build4200860481/b001/cli.test -test.testlogfile=/tmp/go-build4200860481/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s rev-�� --show-toplevel git /usr/bin/git --show-toplevel ache/go/1.25.0/xjs/fuzz_mentions_harness.cjs /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git 40\} ster.patch /usr/bin/git in 2>/dev/null | tr '\n' ':')$PATH"; [ -n "$GOROOT" ] && export (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 GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go m/_n�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name --show-toplevel git /usr/bin/git --show-toplevel go /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git 'origin' 'origin' /opt/hostedtoolcache/node/24.13.xterm-color git (http block)

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

Original prompt

This section details on the original issue you should resolve

<issue_title>[aw] Smoke Claude failed</issue_title>
<issue_description>### Workflow Failure

Workflow: Smoke Claude
Branch: main
Run: https://github.com/github/gh-aw/actions/runs/22532775904

⚠️ Code Push Failed: A code push safe output failed, and subsequent safe outputs were cancelled.
Code Push Errors:

  • push_to_pull_request_branch: Failed to fetch branch dead16: The process '/usr/bin/git' failed with exit code 128

Action Required

Option 1: Assign this issue to Copilot

Assign this issue to Copilot using the agentic-workflows sub-agent to automatically debug and fix the workflow failure.

Option 2: Manually invoke the agent

Debug this workflow failure using your favorite Agent CLI and the agentic-workflows prompt.

Generated from Smoke Claude

  • expires on Mar 8, 2026, 1:11 AM UTC

Comments on the Issue (you are @copilot in this section)


🔒 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.

Fixes the Smoke Claude failure where push_to_pull_request_branch was trying
to actually push to a PR branch even though staged: true was set.

- Parse staged field in parseBaseSafeOutputConfig
- Add AddIfTrue helper to handlerConfigBuilder
- Include staged in handler config for push_to_pull_request_branch and close_pull_request
- Update JS handlers to check config.staged in addition to global GH_AW_SAFE_OUTPUTS_STAGED
- Recompile lock files to include staged:true in handler configs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Debug workflow failure for Smoke Claude fix: propagate per-handler staged: true to JS safe output handlers Mar 1, 2026
@pelikhan pelikhan marked this pull request as ready for review March 1, 2026 02:49
Copilot AI review requested due to automatic review settings March 1, 2026 02:49
@pelikhan pelikhan merged commit effe1c1 into main Mar 1, 2026
108 checks passed
@pelikhan pelikhan deleted the copilot/debug-smoke-claude-failure-another-one branch March 1, 2026 02:51
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

Fixes per-handler staged: true safe-output configuration being ignored by ensuring it’s parsed, propagated into the compiled handler-config JSON, and honored by the relevant JS handlers to avoid live GitHub/git operations.

Changes:

  • Parse staged in parseBaseSafeOutputConfig into BaseSafeOutputConfig.Staged.
  • Extend handler-config compilation with AddIfTrue(...) and include staged for push_to_pull_request_branch and close_pull_request.
  • Update JS handlers to treat staged mode as enabled when either the global env var or per-handler config.staged is set; update tests/lock output accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/workflow/safe_outputs_config.go Parses per-handler staged flag into BaseSafeOutputConfig.
pkg/workflow/compiler_safe_outputs_config.go Adds AddIfTrue helper and emits "staged": true for two handler configs.
pkg/workflow/compiler_safe_outputs_config_test.go Adds assertions intended to validate staged is present in compiled handler-config JSON.
actions/setup/js/push_to_pull_request_branch.cjs Honors per-handler staged config in isStaged computation.
actions/setup/js/close_pull_request.cjs Honors per-handler staged config in isStaged computation.
.github/workflows/smoke-claude.lock.yml Regenerates lockfile handler-config JSON to include "staged":true for affected handlers.

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

Comment on lines +1276 to +1296
for _, step := range steps {
if strings.Contains(step, "GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG") {
parts := strings.Split(step, "GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: ")
require.Len(t, parts, 2, "Should have two parts")

jsonStr := strings.TrimSpace(parts[1])
jsonStr = strings.Trim(jsonStr, "\"")
jsonStr = strings.ReplaceAll(jsonStr, "\\\"", "\"")

var config map[string]map[string]any
err := json.Unmarshal([]byte(jsonStr), &config)
require.NoError(t, err, "Handler config JSON should be valid")

handlerConfig, ok := config[tt.handlerKey]
require.True(t, ok, "Should have %s handler", tt.handlerKey)

stagedVal, ok := handlerConfig["staged"]
require.True(t, ok, "Handler config should include 'staged' field when staged: true is set")
assert.Equal(t, true, stagedVal, "staged field should be true")
}
}
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

TestHandlerConfigStagedMode only asserts inside the loop when it finds a step containing GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG. If that substring is missing (e.g., formatting change) the test can pass without validating anything. Track whether the handler-config line was found and require.True(t, found) after the loop (and consider break after the first match).

Copilot uses AI. Check for mistakes.
Comment on lines 503 to 507
AddIfNotEmpty("target-repo", c.TargetRepoSlug).
AddStringSlice("allowed_repos", c.AllowedRepos).
AddIfNotEmpty("github-token", c.GitHubToken).
AddIfTrue("staged", c.Staged).
Build()
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

Per-handler BaseSafeOutputConfig.Staged is now parsed, but the compiled handler-config JSON only includes staged for a couple handlers. Any other handler configured with staged: true will still have the flag silently ignored. Either propagate staged consistently for all handlers that support staged mode (and update the corresponding JS handlers to read config.staged), or constrain/rename/document the field so it’s clear it only applies to a subset of handlers.

Copilot uses AI. Check for mistakes.
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.

[aw] Smoke Claude failed

3 participants