feat(build-push-sign-images): push extra immutable tags next to the main tag #6

Merged
robin.everaars merged 1 commit from feat/build-push-extra-tags into main 2026-10-28 09:58:23 +00:00
Owner

Why

Client repos pin CI images as <img>:latest@sha256:<digest>. Those pins break within hours: the toolbox pushed latex-full-ci three times on 2026-10-27 and the digests pinned after the first two pushes now return manifest unknown.

Root cause, from the Forgejo source (services/packages/container/manifest.go, createPackageAndVersion): a manifest pushed by tag becomes a package version named after the tag. Pushing the same tag again hits ErrDuplicatePackageVersion and calls DeletePackageVersionAndReferences on the old version, which deletes the old manifest with it. Nothing else keeps that digest alive. Manifests pushed by digest (the cosign signature and attestation referrers) are versions of their own and survive, which is why the September referrers are still there while the images they sign are gone.

Evidence on latex-full-ci:

  • @sha256:7f131e4f… (the 18:25 UTC build) returns 404 manifest unknown.
  • Its signature referrer @sha256:970fa0cf… (subject sha256:7f131e4f…) still resolves, as does the sha256-7f131e4f… referrers tag.
  • :latest resolves to sha256:89a779ad…, the 19:42 UTC build.

What

A new extra-tags input for copyto-sign mode:

  • Each extra tag is pushed before the main tag, so :latest never points at a manifest without its immutable tag.
  • Every push writes its digest with skopeo --digestfile. The image fails closed unless all pushes yield one digest, so the one signature (which binds the digest) covers every tag.
  • An extra tag equal to tag and the input in publish-app mode are rejected instead of being ignored.
  • README: input row, a caveat that explains the registry behaviour and the toolbox example on v0.5.0.

Without extra-tags the behaviour is unchanged apart from the extra --digestfile argument.

Verification

  • The run script extracted from action.yml passes ShellCheck.
  • Ran the script against a stub nix: no extra tags, two extra tags, a digest mismatch (fails and skips signing), a duplicate tag and publish-app with extra-tags (both rejected before the setup gc).
  • skopeo 1.24.1 accepts --digestfile after the positional arguments and gives the same digest for two copies of one image.

After merge

Tag v0.5.0 so the toolbox PR that passes an immutable build tag can move to it.

## Why Client repos pin CI images as `<img>:latest@sha256:<digest>`. Those pins break within hours: the toolbox pushed `latex-full-ci` three times on 2026-10-27 and the digests pinned after the first two pushes now return `manifest unknown`. Root cause, from the Forgejo source (`services/packages/container/manifest.go`, `createPackageAndVersion`): a manifest pushed by tag becomes a package version named after the tag. Pushing the same tag again hits `ErrDuplicatePackageVersion` and calls `DeletePackageVersionAndReferences` on the old version, which deletes the old manifest with it. Nothing else keeps that digest alive. Manifests pushed by digest (the cosign signature and attestation referrers) are versions of their own and survive, which is why the September referrers are still there while the images they sign are gone. Evidence on `latex-full-ci`: - `@sha256:7f131e4f…` (the 18:25 UTC build) returns 404 `manifest unknown`. - Its signature referrer `@sha256:970fa0cf…` (subject `sha256:7f131e4f…`) still resolves, as does the `sha256-7f131e4f…` referrers tag. - `:latest` resolves to `sha256:89a779ad…`, the 19:42 UTC build. ## What A new `extra-tags` input for copyto-sign mode: - Each extra tag is pushed before the main tag, so `:latest` never points at a manifest without its immutable tag. - Every push writes its digest with `skopeo --digestfile`. The image fails closed unless all pushes yield one digest, so the one signature (which binds the digest) covers every tag. - An extra tag equal to `tag` and the input in publish-app mode are rejected instead of being ignored. - README: input row, a caveat that explains the registry behaviour and the toolbox example on `v0.5.0`. Without `extra-tags` the behaviour is unchanged apart from the extra `--digestfile` argument. ## Verification - The run script extracted from `action.yml` passes ShellCheck. - Ran the script against a stub `nix`: no extra tags, two extra tags, a digest mismatch (fails and skips signing), a duplicate tag and publish-app with `extra-tags` (both rejected before the setup gc). - skopeo 1.24.1 accepts `--digestfile` after the positional arguments and gives the same digest for two copies of one image. ## After merge Tag `v0.5.0` so the toolbox PR that passes an immutable build tag can move to it.
The Forgejo container registry stores a tag-pushed manifest as a package
version named after the tag. Re-pushing :latest deletes that version and
its manifest, so every <img>:latest@sha256:<digest> pin breaks with
"manifest unknown" after the next build.

Add an extra-tags input for copyto-sign mode. Each extra tag is pushed
before the main tag, skopeo writes the pushed digest to a file and the run
fails closed unless all pushes produced one digest. The signature binds
the digest, so it covers every tag. publish-app rejects the input instead
of ignoring it.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
HOIST-IT-Actions/actions!6
No description provided.