feat(deploy-deployer): expose Deployer exit code and reason as workfl…#235
Draft
feat(deploy-deployer): expose Deployer exit code and reason as workfl…#235
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_calloutputs.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_calloutputs 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 outputExample usage in a calling workflow:
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 exits0so its outputs are committedassert-result: fails strictly on any non-zero exit code (including warnings, exit2), surfacing the reason via::error::annotationThis is necessary because GitHub Actions only exposes
workflow_calloutputs 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_callresult is stillfailurewhen Deployer fails, sinceassert-resultfails.There is a visual change: the
deployjob will always appear green in the GitHub Actions UI. The failure is now visible in theassert-resultjob instead.Other information
N/A