fix: add success-conclusions as an optional input to control what syn… - #307
Conversation
workflow tests updated workflow tests updated
success-conclusions only used if syncStatus is true
85713f9 to
e8729d8
Compare
PR ReviewAction TypeNode-based — uses Passed Checks
Failed Checks
Warnings
Security FindingsNo security issues found.
SummaryThe feature implementation is solid — the new |
| success-conclusions: | ||
| description: 'Optional comma-separated run conclusions that sync-status treats as a pass. When set, anything not in this list fails. When not set, old behaviour is preserved (only failure and cancelled fail). Valid values: success, failure, neutral, cancelled, skipped, timed_out, action_required, stale, startup_failure.' | ||
| required: false | ||
| default: '' |
There was a problem hiding this comment.
Missing README documentation — this new input has no entry in README.md's "Action Inputs" section. Please add a ### success-conclusions block describing:
- what it does (comma-separated list of conclusions treated as pass)
- valid values (
success,failure,neutral,cancelled,skipped,timed_out,action_required,stale,startup_failure) - that it only takes effect when
sync-status: trueandwait-for-completion: true - that omitting it preserves the old behaviour (only
failure/cancelledfail)
Also update the ### sync-status description to cross-reference this input, since the current wording ("fails or is cancelled") is no longer the full picture.
| // If not set, successConclusions is null and legacy conclusion handling | ||
| // is preserved (failure/cancelled fail, other completed conclusions pass). | ||
| const configuredSuccessConclusions = core.getInput('success-conclusions') | ||
| const successConclusions = |
There was a problem hiding this comment.
The guard syncStatus && configuredSuccessConclusions means that if a user sets success-conclusions: "invalud_typo" but leaves sync-status: false, the value is silently accepted with no warning — the input is unused but the typo is invisible. Consider emitting a core.warning() when configuredSuccessConclusions is non-empty but syncStatus is false, so users catch config drift early:
| const successConclusions = | |
| const configuredSuccessConclusions = core.getInput('success-conclusions') | |
| if (configuredSuccessConclusions && !syncStatus) { | |
| core.warning("'success-conclusions' is set but 'sync-status' is false — the input will be ignored.") | |
| } | |
| const successConclusions = | |
| syncStatus && configuredSuccessConclusions |
PR ReviewAction TypeNode-based action (uses ✅ Passed Checks
❌ Failed ChecksNone.
|
| .filter(Boolean), | ||
| ) | ||
| : null | ||
| if (successConclusions) { |
There was a problem hiding this comment.
The validation guard checks successConclusions (truthy when syncStatus && configuredSuccessConclusions), but the input is only applied when both syncStatus && waitForCompletion are true (line 186). If a user sets sync-status: true but omits wait-for-completion, an invalid success-conclusions value will throw here and abort the run before dispatch — even though the input would never be consulted. Consider tightening the condition to match the documented precondition:
| if (successConclusions) { | |
| if (successConclusions && waitForCompletion) { |
| ) | ||
| } else if (successConclusions) { | ||
| // New configurable behaviour — only when success-conclusions is explicitly set | ||
| if (conclusion && successConclusions.has(conclusion)) { |
There was a problem hiding this comment.
The conclusion && guard is redundant here: we already confirmed runStatusNow === 'completed' on line 199, and a completed GitHub Actions run always carries a non-null conclusion. Removing the guard makes the intent clearer — a completed run that somehow has no conclusion is still treated as a failure, which is the correct safe default.
| if (conclusion && successConclusions.has(conclusion)) { | |
| if (successConclusions.has(conclusion)) { |
No description provided.