Skip to content

feat(deploy-deployer): expose Deployer exit code and reason as workfl…#235

Draft
luislard wants to merge 1 commit intomainfrom
feat/230_add_output_to_deployer_deploy
Draft

feat(deploy-deployer): expose Deployer exit code and reason as workfl…#235
luislard wants to merge 1 commit intomainfrom
feat/230_add_output_to_deployer_deploy

Conversation

@luislard
Copy link
Contributor

@luislard luislard commented Mar 20, 2026

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Feature — exposes Deployer's process exit code and a parsed reason message as workflow_call outputs.

What is the current behavior? (You can also link to an open issue here)

Closes #230

Deployer stdout (info, warnings, errors) is only visible in CI logs. Callers have no way to pass the deployment result to downstream jobs (e.g. Slack notifications).

What is the new behavior (if this is a feature change)?

Two new workflow_call outputs are available:

  • deploy_exit_code — Deployer's process exit code (0 = success, 1 = error, 2 = warning)
  • deploy_reason — a human-readable message parsed from Deployer's output

Example usage in a calling workflow:

slack-notification:
  needs: build-and-deploy
  if: always() && needs.build-and-deploy.result != 'skipped'
  steps:
    - uses: slackapi/slack-github-action@v2
      with:
        payload: |
          text: "Deploy result: ${{ needs.build-and-deploy.outputs.deploy_reason }}"

To make the outputs available even when the deployment fails, the workflow is split into two jobs:

  • deploy: runs the full deployment and captures exit code + reason; always exits 0 so its outputs are committed
  • assert-result: fails strictly on any non-zero exit code (including warnings, exit 2), surfacing the reason via ::error:: annotation

This is necessary because GitHub Actions only exposes workflow_call outputs from jobs that complete successfully.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

No breaking change in workflow behavior — the overall workflow_call result is still failure when Deployer fails, since assert-result fails.

There is a visual change: the deploy job will always appear green in the GitHub Actions UI. The failure is now visible in the assert-result job instead.

Other information

N/A

…ow outputs

Split the single deploy job into two:
- `deploy`: captures Deployer stdout, exit code (0/1/2), and a parsed
  reason message; always exits 0 so outputs are available to callers
- `assert-result`: fails strictly on any non-zero exit code, including
  warnings (exit 2), surfacing the reason via ::error:: annotation

Callers can now consume `deploy_exit_code` and `deploy_reason` outputs
from the workflow_call (e.g. for Slack notifications) regardless of
whether the failure was an error or a warning.
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.

[Feature Request]: Expose Deployer task output as workflow outputs

1 participant