Skip to content

feat(image-tag-cleanup): wire cleanup into Docker Hub + GHCR - #77

Merged
JSisques merged 1 commit into
mainfrom
feat/image-tag-cleanup-02-registries
Sep 16, 2026
Merged

JSisques merged 1 commit into
mainfrom
feat/image-tag-cleanup-02-registries

Conversation

@JSisques

Copy link
Copy Markdown
Contributor

Summary

Second of two PRs implementing image tag retention. Builds on #76's pure selection logic — wires it into real Docker Hub and GHCR API calls, behind a new reusable workflow.

  • cleanup-dockerhub.sh: paginates the Docker Hub tags API, delegates the delete decision to select-deletions.sh, deletes only what it selects.
  • cleanup-ghcr.sh: paginates the GitHub packages API for container versions (a version can carry multiple tags — skipped entirely if any tag doesn't match the ephemeral prefix), same delegation.
  • Composite action image-tag-cleanup wrapping both behind registry: dockerhub | ghcr.
  • New reusable workflow image-cleanup.yml — no on: trigger of its own, the consumer repo owns the schedule (see README usage example).

Also records this as design.md D9 and tasks.md section 6, and documents DOCKERHUB_TOKEN's Read/Write/Delete scope requirement (same trap as the existing Docker Hub description sync).

Chain Context

Field Value
Chain image-tag-cleanup
Tracker PR Not needed (stacked)
Position 2 of 2
Base feat/image-tag-cleanup-01-select-logic
Depends on #76
Follow-up Wire image-cleanup.yml into beacon-api (the pilot repo) with a real schedule, dry_run: true first
Review budget 345 / 400

Chain Overview

main
 └── #76 feat(image-tag-cleanup): add pure ephemeral-tag selection logic
      └── 📍 This PR: registry wiring + reusable workflow + docs

Test plan

  • actionlint clean on image-cleanup.yml
  • shellcheck clean on the new registry scripts
  • tests/image-tag-cleanup-select.test.sh still 9/9 (unchanged logic)
  • Live dry_run: true run against a real repo — planned as the beacon-api follow-up

@JSisques
JSisques changed the base branch from feat/image-tag-cleanup-01-select-logic to main September 16, 2026 09:59
Adds the registry-facing half of tag retention (builds on
feat/image-tag-cleanup-01-select-logic's pure selection logic):

- cleanup-dockerhub.sh: lists tags via the Docker Hub API, deletes
  only what select-deletions.sh selects.
- cleanup-ghcr.sh: lists package versions via the GitHub API (a
  version can carry several tags at once — skipped entirely if any
  tag is non-ephemeral), same delegation.
- Composite action wrapping both behind a registry: dockerhub|ghcr
  input, and a new reusable workflow (image-cleanup.yml) calling it
  once per enabled registry. No on: trigger of its own — the
  consumer repo owns the schedule.

Recorded as design.md D9 and tasks.md section 6. dry_run defaults
false but is documented as the required first step on any new repo.
@JSisques
JSisques force-pushed the feat/image-tag-cleanup-02-registries branch from 035d6e0 to 2e8b2c1 Compare September 16, 2026 10:00
@JSisques
JSisques merged commit 185c066 into main Sep 16, 2026
3 checks passed
@JSisques
JSisques deleted the feat/image-tag-cleanup-02-registries branch September 16, 2026 10:00
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