Skip to content

ci(release): attach revert-to-immich.sql to every release - #982

Merged
Deeds67 merged 1 commit into
mainfrom
ci/attach-revert-script-to-releases
Aug 13, 2026
Merged

ci(release): attach revert-to-immich.sql to every release#982
Deeds67 merged 1 commit into
mainfrom
ci/attach-revert-script-to-releases

Conversation

@Deeds67

@Deeds67 Deeds67 commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Why

Releases shipped only docker-compose.yml and example.env. The revert-to-immich escape hatch was reachable only by browsing the repo at the right tag — and the file changes every few releases (521 lines on main vs 478 at v5.3.1), so grabbing it from main gives you the wrong set of migrations to undo.

What

Attach scripts/revert-to-immich.sql alongside the existing two assets, at all three call sites:

  • gallery-release-server-only.ymlgh release create
  • gallery-prerelease-server.ymlgh release upload --clobber (re-run path)
  • gallery-prerelease-server.ymlgh release create (first-run path)

Both tag jobs already check out at ref: ${{ needs.version.outputs.sha }}, so the uploaded copy is the script as it stood at that release's commit — no git plumbing needed.

Plus a preflight in each version job. It lands there rather than at upload time because the git tag is force-pushed and all images are built before gh release create runs — a missing script would otherwise fail ~an hour in, with a tag already published and no release. The check reads the blob at $sha rather than test -f on the working tree, because the commit: input can pin an older ancestor than the checked-out ref.

Verification

  • Preflight exercised against real commits, both branches: v5.3.1's SHA passes; v4.49.1's SHA (a real commit predating the script) fails with the expected error. Confirms the guard isn't vacuous.
  • actionlint 1.7.12, base vs branch: 12 findings → 12 findings. The one apparent delta is the pre-existing SC2129 shifting from script line 25 → 35 due to the inserted lines. No new findings.
  • bash -n on both edited run: blocks, and YAML parse on both files.

Related

The 35 existing releases that contain the script (v4.50.0 → v5.3.1, prereleases included) were backfilled separately, each with the version from its own tag — verified by downloading each asset back and matching git hash-object against the tag's blob SHA (35/35). v4.49.1 and older predate the script, so the cut is clean.

Releases shipped only docker-compose.yml and example.env, so the
revert-to-immich escape hatch was reachable only by browsing the repo at
the right tag — and the file changes every few releases, so grabbing it
from main gives you the wrong migrations to undo.

Attach scripts/revert-to-immich.sql alongside the existing two assets in
both the release and prerelease workflows. Both tag jobs already check
out at needs.version.outputs.sha, so the uploaded copy is the script as
it stood at that release's commit.

Guard it in the version job rather than at upload time: the tag is
force-pushed and the images are built long before gh release create
runs, so a missing script would otherwise fail an hour in with a tag
already published. The check reads the blob at $sha rather than testing
the working tree, because the `commit` input can pin an older ancestor
than the checked-out ref.

The 35 existing releases that contain the script (v4.50.0 onward) were
backfilled separately; v4.49.1 and older predate it.
@Deeds67 Deeds67 added the changelog:chore Chore/maintenance for changelog label Aug 13, 2026
@Deeds67
Deeds67 merged commit cd4f4d6 into main Aug 13, 2026
45 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:chore Chore/maintenance for changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant