Skip to content

Feature request: post-agent-steps section that runs after the safe_outputs job #35284

Description

@bryanchen-d

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

  • gh-aw: v0.74.x

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions