Skip to content

Comments

Support per-handler staged field for add_labels and remove_labels#16273

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/add-labels-support-staged-field
Closed

Support per-handler staged field for add_labels and remove_labels#16273
Copilot wants to merge 3 commits intomainfrom
copilot/add-labels-support-staged-field

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

Add support for the staged field in BaseSafeOutputConfig for add_labels and remove_labels handlers. Previously, only the global safe-outputs.staged flag was respected.

Changes

  • compiler_safe_outputs_env.go: Check both global and per-handler staged flags (OR logic)
  • safe_output_builder.go: Pass BaseSafeOutputConfig.Staged to env builder
  • safe_outputs_env.go: Add buildStandardSafeOutputEnvVarsWithPerHandlerStaged to handle per-handler flag

Behavior

Staged mode activates when either flag is true:

safe-outputs:
  staged: false
  add-labels:
    staged: true    # Activates staged mode for add_labels only
    allowed: [bug]
  remove-labels:
    allowed: [wontfix]  # Runs normally (global staged=false)

The GH_AW_SAFE_OUTPUTS_STAGED environment variable is set if global_staged || per_handler_staged.

Tests

Added coverage for all flag combinations (global × per-handler) in compiler_safe_outputs_env_test.go and staged_add_issue_labels_test.go.

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 _test.go cal/bin/grep tagedFlag|TestAddLabelsJobWithStagedFlag -t cgroup2 --noheadings /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet staged\|Staged test.go ndor/bin/grep /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name x_amd64/compile -ignore_readdir_git -lname ache/node/24.13..github/workflows/test.md x_amd64/compile _inc�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x-nolocalimports 0/x64/bin/node -unreachable=falgit /tmp/go-build180rev-parse 3774451/b319/vet--git-dir git (http block)
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name bin/sh t0 m0s 3774451/b264/vet--git-dir git _out�� 1206745453/.github/workflows /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet ndor/bin/sh -unreachable=falgit /tmp/go-build180rev-parse /opt/hostedtoolc--show-toplevel 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 staged\|Staged .cfg 64/pkg/tool/linux_amd64/vet staged\|Staged bels_test.go de/node/bin/grep--show-toplevel 64/pkg/tool/linux_amd64/vet -l staged\|Staged pkg/workflow/compile_outputs_label_test.go ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet staged\|Staged test.go k/_temp/ghcca-no--show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha AiXu/G9sEDD2pLhLMDAgEAiXu git ache/go/1.25.0/x64/pkg/tool/linux_amd64/link tierignore x_amd64/vet /usr/bin/git ache/go/1.25.0/x64/pkg/tool/linux_amd64/link 1815�� 181563/b412/styles.test 181563/b406/_testmain.go e/git ignore-path ../.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 staged\|Staged _dependencies_test.go x_amd64/vet staged\|Staged t.go /home/REDACTED/.lo--show-toplevel x_amd64/vet -l staged\|Staged ude_engine_test.go /home/REDACTED/.local/bin/grep staged\|Staged d_test.go ep grep (http block)
    • Triggering command: `/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha 1119284553 git cfg --show-toplevel grep /usr/bin/git git comm�� rite '../../..//*.json' '!../../../pkg/workflow/js//*.json' --ignore-path ../../../.prettiergit Add support for per-handler staged field in add_labels and remove_labels

Co-authored-by: pelikhrev-parse 0/x64/bin/node --show-toplevel grep /usr/bin/git ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet` (http block)

  • https://api.github.com/repos/actions/checkout/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha staged\|Staged .cfg 64/pkg/tool/linux_amd64/vet staged\|Staged n_test.go ache/go/1.25.0/x--show-toplevel 64/pkg/tool/linux_amd64/vet -l staged\|Staged .cfg 64/pkg/tool/linux_amd64/vet staged\|Staged test.go 0/x64/bin/grep 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha -2.15.0.1-py3.12.egg pkg/workflow/github_remote_config_test.go 64/pkg/tool/linux_amd64/vet staged\|Staged test.go de/node/bin/grep--show-toplevel 64/pkg/tool/linux_amd64/vet -l staged\|Staged .cfg 64/pkg/tool/linux_amd64/vet staged\|Staged st.go k/_temp/ghcca-no--show-toplevel 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha -unreachable=false /tmp/go-build1803774451/b058/vet.cfg 3774451/b305/vet.cfg staged\|Staged ration_test.go ache/node/24.13.--show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build1803774451/b185/vet.cfg /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet staged\|Staged ilot_token_parsirev-parse rep /opt/hostedtoolcache/go/1.25.0/xTest User (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 staged\|Staged ion_test.go k/_temp/ghcca-no-nilfunc staged\|Staged _test.go grep grep -l staged\|Staged odules_test.go x_amd64/vet staged\|Staged e_outputs_test.g-V=full /usr/local/sbin/grep x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha 3774451/b328/_pkg_.a grep .cfg staged\|Staged gh/go-spew/spew grep 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/v5 --jq .object.sha -unreachable=false /tmp/go-build1803774451/b101/vet.cfg /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet staged\|Staged mment_test.go /usr/local/sbin/--show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -ato�� tup/sh/sanitize_path.sh' '/usr/bin:/usr/local/bin:::' && echo "$PATH" -buildtags /usr/local/bin/bash -errorsas -ifaceassert -nilfunc bash (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 linuxagent-logcollector.slice .cfg 64/pkg/tool/linux_amd64/vet yAccounting=yes ota=5% yHigh=170M 64/pkg/tool/linux_amd64/vet -l -2.15.0.1-py3.12.egg .cfg 64/pkg/tool/linux_amd64/vet staged\|Staged st.go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha staged\|Staged pkg/workflow/github_remote_config_test.go 64/pkg/tool/linux_amd64/vet staged\|Staged test.go rep 64/pkg/tool/linux_amd64/vet -l rt .cfg 64/pkg/tool/linux_amd64/vet staged\|Staged st.go cal/bin/grep 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 eOutputEnvVars ion_cache.go ion_cache_test.go ion_mode.go ion_pins.go ion_pins_integra--show-toplevel ion_pins_logging_test.go ion_�� ion_reference.go ion_reference_test.go ion_resolver.go ion_resolver_tesgit ion_sha_checker.rev-parse ion_sha_checker_--show-toplevel ion_sha_checker_test.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 staged\|Staged .cfg 64/pkg/tool/linux_amd64/vet staged\|Staged n_test.go cal/bin/grep 64/pkg/tool/linux_amd64/vet -l staged\|Staged .cfg 64/pkg/tool/linux_amd64/vet staged\|Staged test.go /home/REDACTED/.lo--show-toplevel 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 t0 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 staged\|Staged .cfg 64/pkg/tool/linux_amd64/vet staged\|Staged n_test.go k/_temp/ghcca-no--show-toplevel 64/pkg/tool/linux_amd64/vet -l staged\|Staged .cfg 64/pkg/tool/linux_amd64/vet staged\|Staged test.go .go 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 echo "��� Formatting JavaScript files..." git /opt/hostedtoolcache/go/1.25.0/x64/bin/sh --show-toplevel grep bin/node sh -c runs/20260217-011258-15990/test-2091240651 git /node_modules/.bin/node --show-toplevel nly /usr/bin/git node (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 bash x_amd64/vet --noprofile grep ache/go/1.25.0/xuser.name x_amd64/vet _lab�� '**/*.ts' '**/*.json' --ignore-pgo1.25.0 ache/go/1.25.0/x64/pkg/tool/linu-c=4 ode 9260234/b001/worgit /tmp/go-build180rev-parse 9260234/b001/imp--show-toplevel git (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 ache/go/1.25.0/x64/pkg/tool/linu-test.run=^Test x_amd64/compile 3774451/b339/_pkgit khan@users.noreprev-parse ache/go/1.25.0/x--show-toplevel x_amd64/compile _lab�� '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json ache/go/1.25.0/x64/pkg/tool/linux_amd64/cgo /usr/bin/git _IKc/Om-4UtK2STagit /tmp/go-build180config /opt/hostedtoolc--get 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 ache/go/1.25.0/xBranch commit x_amd64/link /var/lib/waagentnode grep /opt/hostedtoolc/home/REDACTED/work/gh-aw/gh-aw/.github/workflows/agent-persona-explorer.md x_amd64/link _lab�� '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu--ignore-path cal/bin/sh -unreachable=falgit /tmp/go-build180rev-parse 3774451/b123/vet--show-toplevel RN/AERBTSiwFBTdGDiIa9qx/amxpLx1vremote.origin.url (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 bash ache/node/24.13.0/x64/bin/node --noprofile grep /opt/hostedtoolc--show-toplevel git stlo�� '**/*.ts' '**/*.json' --ignore-path ../../../.prOUTPUT /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu-d 0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node -unreachable=falgit /tmp/go-build180rev-parse /opt/hostedtoolc--show-toplevel 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 bash x_amd64/vet --noprofile grep ache/go/1.25.0/xuser.email x_amd64/vet _lab�� '**/*.ts' '**/*.json' --ignore-pgo1.25.0 ache/go/1.25.0/x64/pkg/tool/linu-c=4 /usr/bin/git -unreachable=falgit /tmp/go-build180rev-parse /opt/hostedtoolc--show-toplevel git (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 bash ache/node/24.13.0/x64/bin/node --noprofile grep 9260234/b001/wor--git-dir git stlo�� '**/*.ts' '**/*.json' --ignore-path ../../../.prOUTPUT 9260234/b001/workflow.test /usr/bin/git t0 m0s /opt/hostedtoolc--show-toplevel git (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 bash x_amd64/compile --noprofile grep bin/bash x_amd64/compile _lab�� '**/*.ts' '**/*.json' --ignore-path ../../../.prOUTPUT /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu-d /usr/bin/git -unreachable=falgit /tmp/go-build180init /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu../../../**/*.json 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 --show-toplevel 64/pkg/tool/linux_amd64/cgo /opt/hostedtoolcache/go/1.25.0/x64/bin/node staged\|Staged kdown_security_s-c 64/pkg/tool/linu"prettier" --write 'scripts/**/*.js' --ignore-path .prettierignore node /opt�� h ../../../.prettierignore --package-lock-only /usr/bin/git staged\|Staged .cfg 64/pkg/tool/linu--noprofile git (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 .cfg 64/pkg/tool/linu-bool git ance�� js/**/*.json' ---errorsas 64/pkg/tool/linu-ifaceassert 0/x64/bin/node axlifetime=\(.*\git pkg/workflow/coprev-parse DiscussionsEnabl--show-toplevel git (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 3774451/b074/vetinit tnet/tools/bash git _inc�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x-c=4 nfig/composer/vendor/bin/git /tmp/go-build180git -trimpath /opt/hostedtoolcache/go/1.25.0/x--show-toplevel 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 staged\|Staged st.go rep staged\|Staged t.go cal/bin/grep grep -l staged\|Staged go cal/bin/grep staged\|Staged .go /home/REDACTED/.lo--noprofile grep (http block)
    • Triggering command: `/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha 1206745453/.github/workflows /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet ndor/bin/sh -unreachable=falgit /tmp/go-build180rev-parse /opt/hostedtoolc--show-toplevel git rev-�� /.json' '!../../../pkg/workflow/js/**/*.json' --ignore-path ../../../.prettierignore per-handler staged field in add_labels and remove_labels

Co-authored-by: pelikhan <4175913+pelimerge-file 64/pkg/tool/linux_amd64/vet -bool -buildtags /usr/bin/git 64/pkg/tool/linux_amd64/vet` (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 9577300/b001/worgit grep 9577300/b001/imp--show-toplevel git _out�� */*.ts&#39; &#39;**/*.json&#39; --ignore-path ../../../.prettierignore fO5RX86WtsNEP/Dp8vWYtH43curKhv9ozt/aPpZ1LVp5zRIqX1eFw7q/9cHz2qnfO5RX86WtsNEP tnet/tools/git ry=1 -buildtags (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 /usr/bin/git g_.a pkg/workflow/max/home/REDACTED/.npm/_npx/b388654678d519d9/node_modules/.bin/prettier 64/pkg/tool/linu--write git rev-�� h ../../../.pret.prettierignore 64/pkg/tool/linux_amd64/vet /node NhJI_pUqU .cfg 64/pkg/tool/linu--noprofile git (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo /usr/bin/git staged\|Staged .cfg 64/pkg/tool/linu--write git rev-�� h ../../../.pret.prettierignore 64/pkg/tool/linux_amd64/vet /usr/bin/git staged\|Staged .cfg 64/pkg/tool/linux_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state ache/node/24.13.0/x64/bin/node -unreachable=falgit /tmp/go-build180rev-parse 3774451/b305/vet--show-toplevel git tion�� b/workflows /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet bin/node -unreachable=fal/opt/hostedtoolcache/node/24.13.0/x64/bin/node /tmp/go-build180/tmp/test-expr-547619680.js /opt/hostedtoolcinputs.version node (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 --show-toplevel x_amd64/cgo /opt/hostedtoolcache/go/1.25.0/x64/bin/node staged\|Staged kdown_security_s-c x_amd64/link node /opt�� install --package-lock-only /usr/bin/git staged\|Staged .cfg 64/pkg/tool/linu--write git (http block)
  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login tch x_amd64/vet /usr/bin/git staged\|Staged pile_outputs_lab--write (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login --show-toplevel x_amd64/vet /usr/bin/git staged\|Staged pile_outputs_lab/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/pre�� 64/pkg/tool/linu--write git rev-�� --show-toplevel 64/pkg/tool/linu--ignore-path modules/@npmcli/run-script/lib/node-gyp-bin/sh staged\|Staged .cfg 64/pkg/tool/linu&#34;prettier&#34; --write &#39;../../../**/*.json&#39; &#39;!../../../pkg/workflow/js/**/*.json&#39; ---errorsas git (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login tch x_amd64/vet /usr/bin/git staged\|Staged pile_outputs_lab/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/pre�� 64/pkg/tool/linu--write git rev-�� --show-toplevel 64/pkg/tool/linu--ignore-path /usr/bin/git staged\|Staged .cfg 64/pkg/tool/linu&#34;prettier&#34; --write &#39;../../../**/*.json&#39; &#39;!../../../pkg/workflow/js/**/*.json&#39; ---errorsas git (http block)

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


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 17, 2026 01:12
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…rt complete

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for staged boolean field in add_labels/remove_labels Support per-handler staged field for add_labels and remove_labels Feb 17, 2026
Copilot AI requested a review from pelikhan February 17, 2026 01:17
@pelikhan pelikhan closed this Feb 17, 2026
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.

2 participants