Skip to content

Gate PR Docker image publishing behind push-image label; add GHCR cleanup - #18

Merged
sitbon merged 2 commits into
mainfrom
claude/magg-features-cli-r92ff7
Aug 2, 2026
Merged

Gate PR Docker image publishing behind push-image label; add GHCR cleanup#18
sitbon merged 2 commits into
mainfrom
claude/magg-features-cli-r92ff7

Conversation

@sitbon

@sitbon sitbon commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

Changes the Docker publishing policy per discussion: PRs build and test images but no longer publish them by default.

  • push-image label gate: on pull requests, the Push Dev Images job and the pro image push only run when a maintainer adds the push-image label to a same-repo PR (the labeled event type re-triggers the workflow, so adding the label publishes without needing a new push). Fork PRs never push — their GITHUB_TOKEN can't write packages, which previously would have failed the job outright on the first community PR touching magg/**.
  • Artifact retention: the dev-image tar artifacts are only consumed by the next job in the same run, so they now expire after 1 day instead of eating storage quota for 90.
  • Weekly GHCR cleanup (ghcr-cleanup.yml): deletes ephemeral pr-* tags and untagged manifests older than a week, using dataaxiom/ghcr-cleanup-action (multi-arch-safe, with post-run validation). This complements the existing cleanup-untagged job, which runs after branch pushes but never on PR events. Version tags (1.2.3, 1.2, *-dev-py3.x) and moving branch tags (dev, beta) are never touched, so pinned production deployments are unaffected. Manual dispatch supports a dry-run mode (default on).
  • Readme documents the PR image policy.

Note: the two .github/workflows/ file changes must be pushed by a maintainer — neither of this session's credentials has the workflow scope. The commit is provided as a git am-ready patch; this PR is complete once it's applied and pushed to this branch.

Setup after merge: create the push-image label (any color) in the repo's label settings.

🤖 Generated with Claude Code

https://claude.ai/code/session_011JFaNeMxJCxXhQ3J9RQACR


Generated by Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011JFaNeMxJCxXhQ3J9RQACR
Copilot AI review requested due to automatic review settings August 2, 2026 20:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates project documentation around Docker image publishing for pull requests and the cleanup policy for ephemeral GHCR artifacts.

Changes:

  • Document a new PR image publishing gate via a push-image label.
  • Document weekly cleanup of ephemeral pr-* tags and untagged manifests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread readme.md
Comment on lines +139 to +142
Pull requests build and test images but do not publish them unless a maintainer adds the
`push-image` label, which publishes ephemeral `pr-NN` / `pr-NN-dev` tags (same-repo PRs
only). Ephemeral `pr-*` tags and untagged manifests are cleaned up weekly; version tags
are kept forever, so pinned deployments are never affected.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct observation, but intentional: the matching workflow changes cannot be pushed from this automation session (its credentials lack the workflow scope for .github/workflows/ files). They were delivered to the maintainer as a git am-ready patch — see the note in the PR description. This PR should merge only once that patch commit lands on the branch, at which point the README and workflows agree.


Generated by Claude Code

- PR runs now build and test images without publishing. Adding the
  'push-image' label to a same-repo PR publishes the pr-NN / pr-NN-dev
  tags (the 'labeled' event re-triggers the workflow). Fork PRs never
  push - their GITHUB_TOKEN cannot write packages, which previously
  would have failed the job outright.
- Set retention-days: 1 on the dev-image tar artifacts, which are only
  consumed by the next job in the same run.
- Add a weekly ghcr-cleanup workflow that deletes ephemeral pr-* tags
  and untagged manifests older than a week, complementing the post-push
  cleanup-untagged job (which never runs on PR events). Version and
  branch tags are never touched, so pinned deployments are unaffected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011JFaNeMxJCxXhQ3J9RQACR
@sitbon
sitbon merged commit 1fe88cc into main Aug 2, 2026
15 checks passed
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.

3 participants