feat: add success-conclusions to control what sync-status accepts - #306
Draft
alecsammon wants to merge 2 commits into
Draft
feat: add success-conclusions to control what sync-status accepts#306alecsammon wants to merge 2 commits into
alecsammon wants to merge 2 commits into
Conversation
sync-status only fails on a `failure` or `cancelled` conclusion, so every other non-success outcome sets the step to success: - `timed_out` — the triggered run hit a job timeout - `startup_failure` — the run never started (e.g. an invalid workflow file) - `stale` — the run was discarded before it could report - a `null` conclusion, which is what the API returns whenever the run has not completed, including after `wait-for-completion` gives up at its own timeout The last case is the easiest to hit: the wait loop exits on its timeout, warns, and then sync-status reads a `null` conclusion and passes the step — so a job that waited the full timeout reports success while the run it triggered is still going. Fail on the conclusions that unambiguously mean the run did not succeed, and on any run that has not reached `completed`. `neutral`, `skipped` and `action_required` keep passing as before, so runs that deliberately end without doing work are unaffected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Which conclusions should count as a pass depends on why the run was triggered. A gate wants only `success`; a caller that triggers optional work may be happy for a `skipped` run to pass. Hard-coding either choice is wrong for the other. `success-conclusions` takes a comma-separated list of conclusions to treat as a pass, defaulting to the conclusions that pass today, so behaviour is unchanged unless it is set. Setting it to `success` makes the action green only on a genuine pass. The value is validated against the conclusions the API can return, and an unrecognised entry fails before the workflow is dispatched — a typo would otherwise silently widen or narrow what counts as a pass, changing the verdict with no signal. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Why
#304 fixes
sync-statusreporting success for runs that did not succeed, but it has to pick a singleanswer to a question that does not have one: which conclusions count as a pass?
neutral,skippedandaction_requiredare genuinely ambiguous. If the triggered run is a gate —a required status check, or a deploy waiting on a rollout — then only
successshould go green, and askippedrun passing is exactly the kind of silent hole #304 is closing. If instead the caller triggersoptional work, a
skippedrun passing is correct and failing on it would be a regression. #304 keepsthose three passing to stay non-breaking, which is the safe default but leaves the strict case
unavailable.
This makes it the caller's choice.
What
A
success-conclusionsinput: a comma-separated list of conclusionssync-statustreats as a pass.Anything else fails, as does a run that never reaches
completed.The default is
success,neutral,skipped,action_required— precisely the set that passes after #304 — sobehaviour is unchanged unless the input is set. That is asserted by the tests below rather than
claimed.
It also replaces #304's hard-coded fail-set with the allowlist, which is a net simplification: one
concept instead of two, and no list of conclusions to keep in sync with the API.
The value is validated against the conclusions the REST API documents, and an unrecognised entry throws
before the workflow is dispatched. A typo like
succeswould otherwise silently drop out of theallowlist and flip the verdict with no signal — and failing after dispatch would leave a triggered run
nobody is waiting on, which matters when the dispatched workflow is a deploy.
Verification
The repository has no test suite, so as with #304:
npm run lint(eslint + prettier) passes.npm run buildreproduces the bundle with no unrelated churn.action.yamlparses.Docs updated in
README.mdand the input described inaction.yaml.