Summary
Add a frontmatter section post-agent-steps: (mirror of the existing pre-agent-steps: and post-steps:) whose steps are injected into a new job that needs: [agent, safe_outputs] and runs after the safe_outputs job completes — with access to its outputs (e.g. push_commit_sha, push_commit_url, created_pr_number, code_push_failure_count, etc.).
Motivation
The current post-steps: block runs inside the agent job, before the safe_outputs job has had a chance to execute any safe outputs (push, create-PR, add-reviewer, etc.). That makes it impossible to:
- Run a side-effect only when a push actually happened this cycle.
- Run a side-effect only when the push succeeded.
- Pass the resulting commit SHA / PR URL to a downstream system (Slack, telemetry, internal queue).
Example use case from our errors-fix driver:
Re-request a Copilot review only after a push lands. We can't do it as a post-step because push_commit_sha doesn't exist there. We can't do it as a safe-output (add-reviewer) because of #35283. The current alternatives are (a) a separate workflow_run-triggered workflow file, which clutters .github/workflows/, or (b) accepting the flakiness.
Proposed shape
post-agent-steps:
- name: Notify on successful push
if: needs.safe_outputs.outputs.push_commit_sha != ''
run: |
curl ... "sha=${{ needs.safe_outputs.outputs.push_commit_sha }}"
Compile this into a new job:
post_agent:
needs: [agent, safe_outputs]
if: always()
runs-on: ubuntu-latest
steps: # ...user steps...
with all ${{ needs.safe_outputs.outputs.* }} references available.
Related
Environment
Summary
Add a frontmatter section
post-agent-steps:(mirror of the existingpre-agent-steps:andpost-steps:) whose steps are injected into a new job thatneeds: [agent, safe_outputs]and runs after thesafe_outputsjob completes — with access to its outputs (e.g.push_commit_sha,push_commit_url,created_pr_number,code_push_failure_count, etc.).Motivation
The current
post-steps:block runs inside the agent job, before thesafe_outputsjob has had a chance to execute any safe outputs (push, create-PR, add-reviewer, etc.). That makes it impossible to:Example use case from our errors-fix driver:
Proposed shape
Compile this into a new job:
with all
${{ needs.safe_outputs.outputs.* }}references available.Related
add-reviewerignorestarget-repo+ wrong API surface for Copilot bot). Together the two would let us delete a manual workaround.Environment