mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-08-07 09:23:07 +02:00
ci: prune old untagged GHCR package versions
Add actions/delete-package-versions@v5 to both Docker build pipelines to clean up orphaned untagged manifests left behind by multi-arch rebuilds. Uses delete-only-untagged-versions so tagged versions (v*, latest, main, sha-*) are never deleted, with min-versions-to-keep: 10 to protect the freshly-pushed image's own untagged child/attestation manifests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -117,6 +117,16 @@ jobs:
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Delete old untagged package versions
|
||||
if: steps.decide.outputs.changed == 'true'
|
||||
continue-on-error: true
|
||||
uses: actions/delete-package-versions@v5
|
||||
with:
|
||||
package-name: meshcore-mqtt-broker
|
||||
package-type: container
|
||||
delete-only-untagged-versions: "true"
|
||||
min-versions-to-keep: 10
|
||||
|
||||
- name: Skip build (unchanged)
|
||||
if: steps.decide.outputs.changed != 'true'
|
||||
run: echo "Upstream ${{ steps.check.outputs.upstream_sha }} already built; skipping."
|
||||
|
||||
@@ -69,6 +69,16 @@ jobs:
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Delete old untagged package versions
|
||||
if: github.event_name != 'pull_request'
|
||||
continue-on-error: true
|
||||
uses: actions/delete-package-versions@v5
|
||||
with:
|
||||
package-name: ${{ github.event.repository.name }}
|
||||
package-type: container
|
||||
delete-only-untagged-versions: "true"
|
||||
min-versions-to-keep: 10
|
||||
|
||||
- name: Test Docker image
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user