Skip to content

ci: cancel upstream run on downstream cancellation#162

Merged
Jonas Elfering (keulinho) merged 2 commits into
mainfrom
codex/cancel-upstream-on-downstream-cancel
Jun 16, 2026
Merged

ci: cancel upstream run on downstream cancellation#162
Jonas Elfering (keulinho) merged 2 commits into
mainfrom
codex/cancel-upstream-on-downstream-cancel

Conversation

@keulinho

Copy link
Copy Markdown
Contributor

What changed

  • Added an optional upstream-token input to the downstream action.
  • When the watched downstream workflow concludes as cancelled, the action now cancels the upstream workflow run instead of reporting a generic downstream failure.
  • Kept non-cancelled non-success conclusions failing with the actual conclusion in the log.
  • Added a small shell test for success, failure, cancelled, and failed upstream cancellation fallback.

Why

Downstream workflows can be cancelled by concurrency when a newer upstream push supersedes them. Surfacing that as a cancelled upstream run makes the check state match the real cause while still preventing the required downstream check from passing.

Validation

  • bash -n downstream/wait.bash
  • bash downstream/wait.test.bash
  • git diff --check

Relates shopware/shopware#17450

- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Test downstream wait
run: bash downstream/wait.test.bash

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if we want those test scripts 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the alternative would be to inline the code here then I would go with a test script for now.
We don't have a clear structure for testing workflows yet but this can be easily adapted later.

@keulinho Jonas Elfering (keulinho) merged commit c1b5e48 into main Jun 16, 2026
8 checks passed
@keulinho Jonas Elfering (keulinho) deleted the codex/cancel-upstream-on-downstream-cancel branch June 16, 2026 11:42
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.

Downstream workflow: cancelled runs and mergeable_state reported as failures (false negatives)

2 participants