Skip to content

Delete Package Versions workflow deletes the platform manifests of every multi-arch image, so no image tag can be pulled #1760

Closed

Description

@joshunrau

Running the "Delete Package Versions" workflow would break every published container image. Each step calls actions/delete-package-versions with delete-only-untagged-versions: true and min-versions-to-keep: 0, which removes every untagged version of the package. release.yaml builds each image for linux/amd64,linux/arm64 with buildx. A tag such as latest or 2.5.2 therefore names an OCI image index, and that index references its per-platform manifests and buildx attestation manifests by digest only. GHCR lists each of those child manifests as its own untagged package version, so the workflow deletes them. Every tag then points at an index whose manifests are gone. docker compose pull and docker compose up -d fail with manifest unknown for api, gateway, playground and web, for latest and for every past release. Existing deployments cannot upgrade, new ones cannot install, and recovery means re-running a release build for every version still in use.

Where

.github/workflows/delete-package-versions.yaml:11-18 (repeated for gateway, playground and web):

- name: Delete API
  uses: actions/delete-package-versions@v5
  with:
    owner: DouglasNeuroInformatics
    package-name: open-data-capture-api
    package-type: container
    min-versions-to-keep: 0
    delete-only-untagged-versions: true

.github/workflows/release.yaml (build job): platforms: linux/amd64,linux/arm64.

The published latest index today references four untagged manifests:

$ docker manifest inspect ghcr.io/douglasneuroinformatics/open-data-capture-api:latest
application/vnd.oci.image.index.v1+json
sha256:6e24ef238f75… linux/amd64
sha256:b8de304fc599… linux/arm64
sha256:120cd90f5e46… unknown/unknown   (attestation)
sha256:242d12b68111… unknown/unknown   (attestation)

Reproduce

  1. Dispatch the "Delete Package Versions" workflow from the Actions tab. Its one run so far, on 2026-08-06, was cancelled before any step ran.
  2. Run docker pull ghcr.io/douglasneuroinformatics/open-data-capture-api:latest.

Actual: the per-platform and attestation manifests are deleted along with stale untagged builds, and the pull fails with manifest unknown.
Expected: only versions that no tag can reach are deleted, so every tagged image still pulls on both platforms.

Tests

No unit or Playwright test can exercise GHCR. Verify the fix on a throwaway package first. Push a two-platform image, run the cleanup, then confirm that docker manifest inspect <image>:<tag> resolves and that docker pull --platform linux/arm64 <image>:<tag> succeeds.

Suggested fix

Replace the action with one that understands multi-platform images, such as dataaxiom/ghcr-cleanup-action pinned to a commit SHA. It deletes untagged versions but keeps the manifests a tagged index references. If nothing needs that cleanup, delete the workflow instead.

Activity

  1. added
    Bug
    Priority: High
    Difficulty: Low
    Area: Infrastructure
    on Oct 7, 2026
  2. joshunrau commented on Oct 26, 2026

    @joshunrau
    CollaboratorAuthor

    Still applies on main (d86740e). The workflow has not changed since 3a798fc added the playground step, and no open PR touches it, #1822 included.

    What a cleanup would find today

    There is real garbage, but this workflow cannot tell it apart from live manifests. Every push to main rebuilds the images and moves latest and the current version tag to a new index (.github/scripts/release.cjs:25, .agents/docs/playbooks/cut-a-release.md:128-132). The previous index and its four children are left untagged and unreachable. That is why latest no longer resolves to the digests in the issue: it is still 2.5.2, but its amd64 manifest is now sha256:92cda3fce7aa…. Release has succeeded 21 times since the v2.5.2 merge (3c3f081, #1567).

    Those orphans cost nothing. All four images are public, and "GitHub Packages usage is free for public packages" (https://docs.github.com/en/billing/concepts/product-billing/github-packages). Nothing needs this cleanup soon.

    #1822 changes what retention means

    On the #1822 branch, a push to main whose version is already tagged pushes only edge and sha-<7> (.agents/docs/architecture/release-channels.md:45 there). Every index keeps its own sha-<7> tag, so pushes to main stop producing untagged orphans, and the growth becomes one tagged index per image per push. An untagged-only policy, which is what the suggested replacement does with its default options, would then delete almost nothing.

    Plan

    1. Now: delete .github/workflows/delete-package-versions.yaml. Nothing else in the repo references it. A deletion leaves nothing for a unit or e2e test to cover, so the PR should say it is exempt from the test rule in the root AGENTS.md.
    2. After ci: release from release branches and keep latest on tagged releases #1822, and only if the version list is worth pruning: add a scheduled workflow on dataaxiom/ghcr-cleanup-action (latest release v1.2.2), pinned to a commit SHA like the other third-party actions in release.yaml. It is a new third-party action, so it needs sign-off first.
      • Use delete-tags: sha-* with keep-n-tagged (or older-than) and delete-untagged: true.
      • List latest, edge and the version and channel tags in exclude-tags. When delete-tags matches an image that has other tags, the action removes only the matched tag, so release indexes would otherwise lose their sha-<7>.
      • The action drops child manifests from its working set before applying any rule and deletes an index together with its children, so it never deletes the child of a kept image.
      • Run it first with dry-run: true and validate: true against the throwaway package the issue describes.
      • Its README requires each package to grant this repository the Admin role under Manage Actions access. Check that setting on all four packages before the first run.

    Triage note written with Claude Code. Code references point at main @ d86740e.

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

    Area: InfrastructureBugDifficulty: LowPriority: High

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions