Skip to content

fix(ci): keep a main push green when the release run publishes nothing - #805

Merged
Mearman merged 1 commit into
mainfrom
ci-empty-release-matrix
Aug 24, 2026
Merged

fix(ci): keep a main push green when the release run publishes nothing#805
Mearman merged 1 commit into
mainfrom
ci-empty-release-matrix

Conversation

@Mearman

@Mearman Mearman commented Aug 24, 2026

Copy link
Copy Markdown
Member

Any push to main whose commits all fall outside every package path finishes red — while every one of its ten real jobs passes and nothing in the run reports a failure.

Two recent examples, both with failed_jobs=0:

run head released jobs conclusion
151e36f9 12 packages 42 success
2788390e nothing 10 failure
75956c0e nothing 10 failure

Cause

The three post-release fan-out jobs build their matrix from the release job's outputs:

matrix:
  include: ${{ fromJSON(needs.release.outputs.github-packages-matrix) }}

Those outputs are [] when the orchestrator finds nothing to release. matrix: include: [] is not an empty matrix that skips the job — it is an invalid matrix. The job never instantiates, so it appears nowhere in the job list, and the run concludes failure with no failed job to point at.

The release job's own comment asserted the opposite ("leaves the consuming job's matrix empty and the job skipped"), which is presumably why it was never guarded. That comment is corrected here rather than left to mislead the next reader.

Fix

Each consuming job now tests its own matrix output for emptiness in its if, alongside the existing branch/event conditions.

Verifying this

This PR is itself the test case: it only touches .github/, so merging it produces a main push that releases nothing — precisely the condition that currently fails. If the post-merge run is green, the fix holds.

Pre-existing, not a regression from the recent CI work — it was simply latent until a main push happened to release nothing.

The three post-release fan-out jobs build their matrix from the release job's
output, which is [] whenever the orchestrator finds nothing to release.
`matrix: include: []` is not an empty matrix that skips the job -- it is an
invalid matrix, so the job never instantiates and the run concludes failed with
no failed job anywhere in it to explain why.

Any push to main whose commits fall outside every package path hits this: all
ten real jobs pass and the run is still red.
Each consuming job now tests its own matrix output for emptiness before running.

The release job's own comment asserted the behaviour this relies on and had it
backwards, so it is corrected rather than left to mislead the next reader.
@Mearman
Mearman marked this pull request as ready for review August 24, 2026 16:34
@Mearman
Mearman merged commit 8a70023 into main Aug 24, 2026
15 checks passed
@Mearman
Mearman deleted the ci-empty-release-matrix branch August 24, 2026 16:35
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.

1 participant