Skip to content

fix(safe-outputs): include pull_request_target in PR context detection#20198

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-safe-outputs-triggering
Mar 9, 2026
Merged

fix(safe-outputs): include pull_request_target in PR context detection#20198
pelikhan merged 2 commits intomainfrom
copilot/fix-safe-outputs-triggering

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

resolveTarget() rejected pull_request_target events as non-PR context, causing target: "triggering" safe-output operations (e.g. update-pull-request) to silently skip or fail when workflows are triggered via pull_request_target.

Changes

  • actions/setup/js/safe_output_helpers.cjs: Added pull_request_target to isPRContext alongside the existing pull_request, pull_request_review, and pull_request_review_comment checks.

  • actions/setup/js/safe_output_helpers.test.cjs: Regression tests for pull_request_target in both supportsPR=true (labels) and supportsPR=false (reviewers) paths.

// Before
const isPRContext = context.eventName === "pull_request" ||
  context.eventName === "pull_request_review" ||
  context.eventName === "pull_request_review_comment";

// After
const isPRContext =
  context.eventName === "pull_request" ||
  context.eventName === "pull_request_target" ||   // ← added
  context.eventName === "pull_request_review" ||
  context.eventName === "pull_request_review_comment";

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 x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git -json b80ae66e:go.mod 64/pkg/tool/linu--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 /opt/hostedtoolcauth /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel (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 /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha /tmp/gh-aw-test-runs/20260309-104722-34123/test-4040272908/custom/workflows rev-parse /usr/bin/git --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git git init�� les.test git ache/node/24.14.0/x64/bin/node --show-toplevel les.test /usr/bin/git ache/node/24.14.0/x64/bin/node (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 runs/20260309-104643-29603/test-2843205887/.github/workflows /tmp/go-build2724792269/b035/vet.cfg ache/node/24.14.0/x64/bin/node heck '**/*.cjs' git GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet t-11�� sistency_GoAndJavaScript2119764844/001/test-complex-frontmatter-with-tools.md /tmp/go-build2724792269/b254/vet.cfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel git ache/node/24.14.0/x64/bin/node --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git t-15�� sistency_WithImports3472349482/001/main.md git 2504276/b418/vet.cfg --show-toplevel 64/pkg/tool/linurev-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 g_.a GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE ole GOMODCACHE 64/pkg/tool/linux_amd64/vet env MpDWJWFFv .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel x_amd64/link /usr/bin/git -json GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /opt/hostedtoolcache/node/24.14.0/x64/bin/node -json GO111MODULE x_amd64/vet /opt/hostedtoolcache/node/24.14.0/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git LX1pvVSUv .cfg 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git ternal/tools/gengit 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 /tmp/gh-aw-test-runs/20260309-104643-29603/test-3976675739/.github/workflows rev-parse /tmp/go-build2724792269/b409/parser.test npx prettier --cgit GOPROXY 64/bin/go /tmp/go-build2724792269/b409/parser.test -tes�� -test.paniconexit0 (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha /tmp/gh-aw-test-runs/20260309-104643-29603/test-1014219130/.github/workflows config /opt/hostedtoolcache/node/24.14.0/x64/bin/node remote.origin.urgit GOPROXY 64/bin/go node /tmp�� /tmp/TestHashConsistency_GoAndJavaScript2119764844/001/test-empty-frontmatter.md sh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git 1014219130/.githgit .cfg 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git 44/001/test-emptgit .cfg 64/pkg/tool/linu--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 bXlA/sjBQ9JPRCPtGOSUMDB GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 074353/b391/impo-buildtags -c che/go-build/12/-errorsas GOPROXY 64/bin/go iles use Prettie/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOWORK 64/bin/go /opt/hostedtoolc-buildtags (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha prettier --check 64/bin/go **/*.ts **/*.json --ignore-path /bin/sh -c GOPATH=$(go env GOPATH); \ if coGOINSECURE sh 64/bin/go -d (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha prettier --check 64/bin/go **/*.ts **/*.json --ignore-path git conf�� extensions.objec-errorsas sh 64/bin/go -d (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 /tmp/gh-aw-test-runs/20260309-104643-29603/test-1683153829/.github/workflows rev-parse ache/node/24.14.0/x64/bin/node npx prettier --cgit GOPROXY 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/compile t-18�� k/gh-aw/gh-aw/.github/workflows/artifacts-summary.md -trimpath ache/node/24.14.0/x64/bin/node -p github.com/githurev-parse -lang=go1.25 ache/node/24.14.0/x64/bin/node (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 --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git init�� ache/go/1.25.0/x--show-toplevel (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 --show-toplevel sh /tmp/go-build2724792269/b416/sliceutil.test npx prettier --cgit GOPROXY 64/bin/go /tmp/go-build2724792269/b416/sliceutil.test -tes�� -test.paniconexit0 -test.v=true /opt/hostedtoolcache/node/24.14.0/x64/bin/node -test.timeout=10git -test.run=^Test -test.short=true--show-toplevel node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha -bool -buildtags /opt/hostedtoolcache/node/24.14.0/x64/bin/node -errorsas -ifaceassert -nilfunc node /tmp�� /tmp/TestHashStability_SameInputSameOutput1861935225/001/stability-test.md -tests /usr/bin/git --show-toplevel obeEfelO93FaBYpQrev-parse /usr/bin/git 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 -json GO111MODULE 4792269/b193/vet.cfg GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build2724792269/b165/vet.cfg 4792269/b320/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel git ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet --get remote.origin.urrev-parse /usr/bin/git ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet rev-�� --show-toplevel git /usr/bin/git --show-toplevel x_amd64/vet /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 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link /usr/bin/git /tmp/go-build272git -importcfg /usr/bin/gh git init�� -buildmode=exe gh 64/pkg/tool/linux_amd64/vet /repos/actions/ggit --jq /usr/bin/git 64/pkg/tool/linux_amd64/vet (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/pkg/tool/linu-nolocalimports GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linu/tmp/go-build2724792269/b422/_testmain.go estl�� g_.a GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 /tmp/go-build2724792269/b416/sliceutil.test /usr/bin/git -test.paniconexigit -test.v=true /opt/hostedtoolc--show-toplevel git rev-�� --show-toplevel node /usr/bin/git /tmp/TestHashStagit go r,url,status,con--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 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet estl�� -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 infocmp /usr/bin/git xterm-color sh (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/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/link env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 infocmp /usr/bin/git xterm-color node /opt/hostedtoolc--show-toplevel git conf�� user.email test@example.com /usr/bin/git /tmp/TestHashStagit go /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/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 node /usr/bin/git /tmp/TestHashCongit node /usr/bin/infocmp--show-toplevel git conf�� user.name Test User 64/pkg/tool/linux_amd64/vet xterm-color go /usr/bin/git 64/pkg/tool/linux_amd64/vet (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/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linutest@example.com env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 node /usr/bin/git /tmp/TestHashCongit node /opt/hostedtoolc--get git add initial.txt /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git -unreachable=falgit /tmp/go-build272rev-parse /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 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git -bool -buildtags /opt/hostedtoolcSecret: ${{ secrets.TOKEN }} git comm�� -m Initial commit /usr/bin/git -unreachable=falgit /tmp/go-build272rev-parse /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 ." GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 074353/b389/impo-buildtags /hom�� che/go-build/a1/-errorsas **/*.cjs 64/bin/go **/*.json --ignore-path ../../../.pretti-bool /opt/hostedtoolc-buildtags (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 --ignore-path ../../../.pretti-bool /opt/hostedtoolc-buildtags -o /tmp/go-build281-errorsas -trimpath 64/bin/go -p main -lang=go1.25 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 6 GOMOD GOMODCACHE x_amd64/link env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE a7/uvoaxXZ6SdsIYTest User (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/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json .cfg x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel ser.test /usr/bin/git se 4792269/b227/vet-atomic ache/go/1.25.0/x-bool git rev-�� --show-toplevel ache/go/1.25.0/x-ifaceassert (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 "prettier" --check 'scripts/**/*GOINSECURE node 64/bin/go prettier on 64/bin/go go env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git rEXa8Ewqh GO111MODULE ache/go/1.25.0/xif [ -f .github/aw/actions-lock.json ]; then \ cp .github/aw/actions-lock.json pkg/workflow/data/action_pins.json; \ echo "��� Action pins synced successfully"; \ else \ echo "��� Warning: .github/aw/actions-lock.json does not exist yet" ; \ fi rev-�� --show-toplevel ortcfg /usr/bin/git g/sliceutil/slicgit g/sliceutil/slic-C ache/go/1.25.0/x/tmp/gh-aw-test-runs/20260309-104722-34123/test-4114323453/.github/workflows 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 "prettier" --check 'scripts/**/*GOINSECURE node 64/bin/go tierignore on 64/bin/go go env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha --check scripts/**/*.js 64/bin/go .prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha --show-toplevel ache/go/1.25.0/x/tmp/go-build2724792269/b433/_testmain.go /usr/bin/git -json GO111MODULE ache/go/1.25.0/xecho "Syncing install-gh-aw.sh to actions/setup-cli/install.sh..." git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linu-importcfg /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git (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 "prettier" --check 'scripts/**/*GOINSECURE sh 64/bin/go tierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git se 4792269/b119/vet-c 0/x64/bin/node git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git SameOutput362795git GO111MODULE (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/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env 3976675739/.github/workflows .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git vaScript21197648/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link 4792269/b237/vet-o 64/pkg/tool/linu/tmp/go-build2822504276/b383/cli.test git rev-�� --show-toplevel 64/pkg/tool/linu-w (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 64/pkg/tool/linux_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion user.email test@example.comrev-parse /usr/bin/git git rev-�� HEAD git /usr/bin/git -b feature-branch DiscussionsEnabl--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 074353/b418/impo/tmp/go-build2724792269/b119/vet.cfg /hom�� che/go-build/cc/cc66783205f4d985GOINSECURE **/*.cjs 64/bin/go **/*.json --ignore-path ../../../.pretti-bool go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE node /hom�� --check **/*.cjs 64/bin/go **/*.json --ignore-path run-script/lib/n-bool go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo /usr/bin/git g_.a 4792269/b014/vetrev-parse 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git g_.a 4792269/b142/vetrev-parse ache/go/1.25.0/x--show-toplevel git (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build2724792269/b383/cli.test /tmp/go-build2724792269/b383/cli.test -test.testlogfile=/tmp/go-build2724792269/b383/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE sh -c "prettier" --che-errorsas GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go gcc (http block)
    • Triggering command: /tmp/go-build2822504276/b383/cli.test /tmp/go-build2822504276/b383/cli.test -test.testlogfile=/tmp/go-build2822504276/b383/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true 7997/001/stabiliinfocmp GO111MODULE ache/go/1.25.0/xxterm-color git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet otOrdering489497151/001/go/1.25.0/x64/bin/go se 4792269/b083/vetrev-parse 64/pkg/tool/linu--show-toplevel 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 Frhr/oi7Pkm9e-ggGOSUMDB GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 074353/b401/impo-buildtags /hom�� 074353/b401/embe-errorsas **/*.cjs 64/bin/go **/*.json --ignore-path ../../../.pretti-bool /opt/hostedtoolc-buildtags (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name --show-toplevel aw.test /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git agent-performancgit 4792269/b101/vetrev-parse ache/go/1.25.0/x--show-toplevel git (http block)

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…puts resolveTarget

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix safe-outputs for triggering in pull_request_target context fix(safe-outputs): include pull_request_target in PR context detection Mar 9, 2026
@pelikhan pelikhan marked this pull request as ready for review March 9, 2026 10:54
Copilot AI review requested due to automatic review settings March 9, 2026 10:54
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 safe-outputs PR context detection so resolveTarget() treats pull_request_target as a valid pull request context, preventing target: "triggering" operations from being skipped when workflows run via pull_request_target.

Changes:

  • Extend PR-context detection in resolveTarget() to include the pull_request_target event.
  • Add regression tests covering pull_request_target behavior for both supportsPR=true and supportsPR=false modes.

Reviewed changes

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

File Description
actions/setup/js/safe_output_helpers.cjs Adds pull_request_target to PR context detection used by resolveTarget().
actions/setup/js/safe_output_helpers.test.cjs Adds tests ensuring pull_request_target resolves the triggering PR number in both handler modes.

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

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

@pelikhan pelikhan merged commit 17b510d into main Mar 9, 2026
111 checks passed
@pelikhan pelikhan deleted the copilot/fix-safe-outputs-triggering branch March 9, 2026 11:03
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.

safe-outputs: target="triggering" rejects pull_request_target PR context

3 participants