Skip to content

fix: don't let a false trailing condition fail publish.yml steps#45

Merged
coretl merged 2 commits into
mainfrom
fix/stable-alias-set-e
Jul 3, 2026
Merged

fix: don't let a false trailing condition fail publish.yml steps#45
coretl merged 2 commits into
mainfrom
fix/stable-alias-set-e

Conversation

@coretl

@coretl coretl commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Two run: steps in publish.yml end with cond && action as their final statement. A shell script's exit status is its last command's, so when the condition is false the step (and job) fails even though nothing went wrong:

  • "Extract artifacts into site": [ -d ... ] && [ -f "$dzip" ] && { ...persist _sources...; } — fails when there's no default-branch zip to persist.
  • "Generate switcher.json and stable alias": [ -n "$stable_src" ] && ln -s ... — fails when there's no release yet to alias as stable/.

Hit for real on PandABlocks-FPGA (PR #289 there): a fresh migration with no MyST-built release yet leaves stable_src empty, so generate succeeds but the step still reports failure and publish never deploys. Introduced by 811914e (between v0.18.0 and v0.19.0) — any repo bumping past v0.18.0 without an existing release hits this.

Fix: append || true to both trailing conditionals so a false condition is treated as "nothing to do", not "step failed".

Test plan

  • Reproduced the bash exit-status behavior locally ([ -n "" ] && echo x as a script's last line exits 1 under set -e)
  • CI green on this PR
  • Cut a release once merged, bump PandABlocks-FPGA's pin, confirm its publish job goes green

Two steps in publish.yml end their run: script with `cond && action` as
the last statement. bash's exit status is the last command's, so when
the condition is false (no default-branch zip to persist as a source,
or no release yet to alias as stable/) the step — and the job — fails
even though nothing went wrong. Hit for real on PandABlocks-FPGA: a
fresh migration with no MyST-built release yet makes stable_src empty,
and the Generate switcher.json step fails despite a correct assemble.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coretl coretl temporarily deployed to github-pages July 3, 2026 16:11 — with GitHub Actions Inactive
@coretl coretl merged commit d1a9343 into main Jul 3, 2026
7 checks passed
@coretl coretl deleted the fix/stable-alias-set-e branch July 3, 2026 16:13
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