Skip to content

fix: stop the raw dispatch tag from moving :latest on every run - #72

Merged
Ilyes512 merged 2 commits into
mainfrom
fix/raw-latest-tag-on-dispatch-only
Sep 22, 2026
Merged

Ilyes512 merged 2 commits into
mainfrom
fix/raw-latest-tag-on-dispatch-only

Conversation

@Ilyes512

Copy link
Copy Markdown
Member

Summary

  • Replace event=workflow_dispatch with enable=${{ github.event_name == 'workflow_dispatch' }} on the type=raw directive in create-manifest and build-image.
  • Document in docs/pipeline.md that event= belongs to type=ref only, and that flavor: latest=false does not govern an explicit raw tag.

The bug

type=raw,event=workflow_dispatch,value=... does not do what it reads like. event= is an attribute of type=ref; type=raw takes only enable, priority, prefix, suffix and value. metadata-action ignores the unrecognised attribute rather than failing, so the directive reduced to a plain type=raw,value=latest that applied to every run — branch builds and prereleases included.

specs-cli v0.0.14-rc.2 is the visible case. The merge job's tag list came out as:

ghcr.io/specsnl/specs-cli:0.0.14-rc.2
ghcr.io/specsnl/specs-cli:v0.0.14-rc.2
ghcr.io/specsnl/specs-cli:latest

So :latest currently points at a release candidate, which both docs/pipeline.md and docs/go-cli.md promise cannot happen. The guards meant to prevent it had all fired correctly — the run shows type=raw,value=latest,suffix=,enable=false and flavor: latest=false — because neither governs a second, unconditional raw tag.

Note on build-image

There the tag never reached the registry, since that build pushes by digest. But it was the only directive in the block, so it became org.opencontainers.image.version — which is why release builds were labelled version=latest. That label is now absent rather than wrong; build-image takes no version input, so it was never derived from anything meaningful. metadata-action will log No Docker tag has been generated there on tag and branch builds. If a correct per-arch version label is wanted, that is a follow-up: build-image would need a version input the way create-manifest has one.

Scope

create-manifest is shared, so the same wrong :latest behaviour applied to every image built through this pipeline, the PHP images included.

Verified with actionlint.

`type=raw,event=workflow_dispatch,value=...` does not do what it reads like.
`event=` is an attribute of `type=ref`; `type=raw` takes only enable, priority,
prefix, suffix and value. metadata-action ignores the attribute it does not
recognise, so the directive reduced to a plain `type=raw,value=latest` and
applied to every run — branch builds and prereleases included.

specs-cli v0.0.14-rc.2 is the visible case: the merge job's tag list came out as
0.0.14-rc.2, v0.0.14-rc.2 and latest, so :latest now points at a release
candidate. The guards meant to prevent that had all fired correctly —
`type=raw,value=latest,suffix=,enable=false` and `flavor: latest=false` — because
neither governs a second, unconditional raw tag.

Swaps `event=` for `enable=${{ github.event_name == 'workflow_dispatch' }}` in
both actions.

In build-image the tag never reached the registry, since that build pushes by
digest, but it was the only directive in the block and so became
org.opencontainers.image.version — which is why release builds were labelled
"latest". That label is now absent rather than wrong; build-image takes no
version input, so it was never derived from anything meaningful. metadata-action
will log "No Docker tag has been generated" there on tag and branch builds.
@Ilyes512
Ilyes512 force-pushed the fix/raw-latest-tag-on-dispatch-only branch from 6b488e8 to fa2484f Compare September 22, 2026 10:19
@Ilyes512
Ilyes512 merged commit 62f3382 into main Sep 22, 2026
1 check passed
@Ilyes512
Ilyes512 deleted the fix/raw-latest-tag-on-dispatch-only branch September 22, 2026 10:26
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