Summary
safe-outputs operations using target: \"triggering\" can incorrectly fail in pull_request_target runs with:
Target is \"triggering\" but not running in pull request context
Repro
- Trigger workflow on
pull_request_target (e.g. synchronize).
- Use reusable
gh-aw workflow with a PR-scoped safe output (example: update-pull-request with default target: \"triggering\").
- Observe warning/error in safe outputs job:
Expected
pull_request_target should be treated as PR context for target: \"triggering\" resolution, same as pull_request.
Actual
Resolver rejects the context and skips/fails the message as not in PR context.
Suspected cause
actions/setup/js/safe_output_helpers.cjs PR-context detection for resolveTarget() includes:
pull_request
pull_request_review
pull_request_review_comment
but excludes pull_request_target.
Proposed fix
Include pull_request_target in PR-context detection in resolveTarget() and add regression tests in safe_output_helpers.test.cjs.
Summary
safe-outputsoperations usingtarget: \"triggering\"can incorrectly fail inpull_request_targetruns with:Target is \"triggering\" but not running in pull request contextRepro
pull_request_target(e.g. synchronize).gh-awworkflow with a PR-scoped safe output (example:update-pull-requestwith defaulttarget: \"triggering\").Expected
pull_request_targetshould be treated as PR context fortarget: \"triggering\"resolution, same aspull_request.Actual
Resolver rejects the context and skips/fails the message as not in PR context.
Suspected cause
actions/setup/js/safe_output_helpers.cjsPR-context detection forresolveTarget()includes:pull_requestpull_request_reviewpull_request_review_commentbut excludes
pull_request_target.Proposed fix
Include
pull_request_targetin PR-context detection inresolveTarget()and add regression tests insafe_output_helpers.test.cjs.