Skip to content

fix(ci): give each publish a tag that never moves #17

Closed

Description

@dan-petty

Problem

The publish job tags each manifest list with the date tag YYYYMMDD. Each push to main and the daily rebuild publish a new manifest list, so the date tag moves to a new digest more than once on most days. On 2026-11-20, seven runs on main published, and the tag 20261120 moved seven times. Each move leaves the earlier manifest list with no tag.

The devops-cli devcontainer and Job images pin such digests. A tag that moves does not identify one image, and a later clean-up of untagged versions would delete digests that consumers pin.

Change

  • Each publish gets a tag that no later publish reuses, with the date first so that the tags sort by date.
  • The label org.opencontainers.image.version of each platform image has the same value as that tag.
  • The publish job stops when the tag already points to a different digest.
  • latest moves as before, after the attestation.

Proof

  • Two publishes on one day give two tags, and each tag keeps its digest.
  • skopeo inspect of a pushed platform image shows the new tag in org.opencontainers.image.version.

Proposed design

Problem statement

The publish workflow reuses the date tag YYYYMMDD for every publish. The tag moves to a new digest more than once a day. Consumers pin digests, and a clean-up can delete the earlier untagged digests. The change gives each publish an immutable date-first tag, keeps org.opencontainers.image.version equal to that tag, and stops a publish that would move an existing tag.

Acceptance criteria

Requirement: Immutable date-first tag

The publish workflow SHALL give each publish a unique tag that starts with the UTC date and SHALL NOT publish the moving YYYYMMDD tag.

Scenario: Two publishes on one date

  • WHEN Two publish runs start on 2026-11-20 in a clean registry with different run IDs
  • THEN docker buildx imagetools inspect shows the tags 20261120-<run_id>-<attempt> and 20261120-<run_id_2>-<attempt_2> with their original digests, and docker buildx imagetools inspect <image>:20261120 reports that the tag does not exist.

Requirement: Platform image version label

Each platform image SHALL set org.opencontainers.image.version to the same value as its immutable publish tag.

Scenario: Inspect a pushed platform image

  • WHEN A publish pushes a platform image by digest with the immutable tag 20261120-<run_id>-<attempt>
  • THEN skopeo inspect docker://<image>@<platform_digest> shows org.opencontainers.image.version equal to 20261120-<run_id>-<attempt>.

Requirement: Existing tag guard

The publish job MUST stop before it moves an existing immutable tag to a different digest.

Scenario: Tag points to another digest

  • WHEN The immutable tag already points to a digest that differs from the new manifest list
  • THEN The publish job exits with a non-zero status, and docker buildx imagetools inspect <image>:<immutable_tag> shows the original digest.

Requirement: Latest after attestation

The publish job SHALL move latest only after the attestation passes.

Scenario: Attestation succeeds

  • WHEN The attestation step passes for the immutable tag
  • THEN docker buildx imagetools inspect <image>:latest shows the same digest as <image>:<immutable_tag>.

Requirement: Workflow validation

The image workflow MUST pass the project workflow checks.

Scenario: Workflow lint

  • WHEN uv run devops ci --check --only actionlint,zizmor runs
  • THEN The command exits 0 and reports no error for .github/workflows/image.yml.

Existing Tool Considered

No alternatives check has run. The open and maintained docker/metadata-action covers the tag and label generation. It lacks a built-in date-first tag that is unique for each run, so the workflow uses a raw template with github.run_id and github.run_attempt. The open and maintained docker buildx imagetools covers digest inspection and manifest-list creation. It lacks an overwrite guard, so the workflow adds a short check before imagetools create. The change builds no separate library or tool.

Key questions

  • Which tag format gives a unique date-first tag for every publish?: Use YYYYMMDD-<github.run_id>-<github.run_attempt>. (best practice) [sources: .github/workflows/image.yml:222]
    • Chosen: Date, run ID and run attempt. The run ID is unique for each workflow run. The run attempt is unique for each rerun. The date comes first.
    • Rejected: Date and timestamp. Two runs can start in the same second and then reuse a tag.
    • Rejected: Date and commit SHA. A daily rebuild can publish the same commit again and reuse the tag.
    • Rejected: Date and run ID only. A rerun of the same workflow run can publish again and reuse the tag.
  • How does the publish job detect that a tag already points to a different digest?: Run docker buildx imagetools inspect on the tag before imagetools create. Stop with a non-zero status when the tag exists and its digest differs. (best practice) [sources: .github/workflows/image.yml:442]
    • Chosen: docker buildx imagetools inspect. The workflow already uses docker buildx imagetools. The command reads the tag digest without a new tool.
    • Rejected: skopeo inspect. It adds a tool to the publish job. The workflow does not use it for this check.
    • Rejected: Let imagetools create overwrite the tag. The overwrite moves the tag and loses the earlier digest.
  • Where does the version label get its value?: A tag job computes the immutable tag once from the UTC date, github.run_id and github.run_attempt. The platform build and publish jobs take the value from that job output. (best practice) [sources: .github/workflows/image.yml:222, .github/workflows/image.yml:412, README.md:116]
    • Chosen: One tag job output. The platform image and the manifest list get the same value. The date and run values cannot differ between jobs.
    • Rejected: docker/metadata-action version output. The output depends on the tag order. An explicit value is clearer.
    • Rejected: A separate date command in each job. A run near midnight can get two dates. The label and the tag can differ.
  • Does the workflow keep the moving YYYYMMDD tag?: No. Remove the moving date tag. Keep latest as the only moving tag. (best practice) [sources: .github/workflows/image.yml:222, .github/workflows/image.yml:412, README.md:126]
    • Chosen: Remove the moving date tag. The moving tag does not identify one image. It leaves earlier digests untagged.
    • Rejected: Keep the moving date tag and add the immutable tag. The moving tag still moves and still leaves earlier digests untagged.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-20: in-use.
The repository already uses this tool.
Tool: docker/metadata-action (https://github.com/docker/metadata-action), Apache-2.0, last activity 2026-11-12, maintained.
Reason: Searches found docker/metadata-action, which generates tags and OCI labels, including org.opencontainers.image.version, from date and env templates, but offers no built-in run-unique tag or overwrite guard, so it covers only part of the need.

Covers:

  • Tag and OCI label generation from GitHub events
  • Raw tag templates with UTC date expressions
  • Sets the org.opencontainers.image.version label

Lacks:

  • No built-in run-unique date-first tag
  • No guard against moving an existing tag
  • No manifest list creation or attestation

Activity

  1. added
    type/bug
    status/new
    value/medium
    effort/low
    on Nov 20, 2026
  2. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor
  3. added
    source/agent
    scope/ci
    priority/p2-medium
    on Nov 20, 2026
  4. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  5. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (4)

    Tools considered:

    Searches run:

    • docker/metadata-action unique tag per workflow run date run_id, results: 5
    • docker buildx imagetools create prevent overwrite existing tag immutable, results: 5
    • registry immutable tags prevent tag overwrite tool ghcr, results: 5
    • metadata-action type=raw value env.GITHUB_RUN_ID template attributes, results: 5

    Sources:

  6. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 20, 2026
  7. added a commit that references this issue on Nov 20, 2026
    462e0ba
  8. removed
    status/in-review
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/cisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions