Skip to content

Commit 122cca4

Browse files
prontclaude
andauthored
chore(ci): update GHCR cleanup workflow (#25037)
* chore(ci): improve GHCR cleanup workflow - Add step to delete dated nightly tags older than 30 days, guarded against semver/release tags - Increase test-runner cleanup batch size from 50 to 100 - Add continue-on-error to test-runner step - Update workflow name and header comment Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore(ci): replace gh CLI step with action for dated nightly cleanup Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * use ubuntu-24.04 * keep 30 nightlies --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6a50bd5 commit 122cca4

1 file changed

Lines changed: 18 additions & 14 deletions

File tree

.github/workflows/cleanup-ghcr-images.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,43 @@
22
#
33
# This workflow cleans up old images from GitHub Container Registry
44
# to prevent unlimited storage growth. It runs weekly and removes:
5-
# 1. Untagged images from all packages (intermediate build artifacts)
6-
# 2. Old test-runner versions (keeps 50 most recent, deletes up to 50 oldest)
5+
# 1. Old dated nightly tags for vector (keeps last ~8)
6+
# 2. Old test-runner versions (keeps 5 most recent)
77

8-
name: Cleanup Untagged GHCR Images
8+
name: Cleanup GHCR Images
99

1010
on:
1111
schedule:
1212
# Run weekly on Sundays at 2 AM UTC
13-
- cron: '0 2 * * 0'
13+
- cron: "0 2 * * 0"
1414
workflow_dispatch:
1515

1616
permissions:
17-
contents: read # Restrictive default
17+
contents: read # Restrictive default
1818

1919
jobs:
20-
cleanup:
21-
runs-on: ubuntu-latest
20+
cleanup-vector-nightlies:
21+
runs-on: ubuntu-24.04
2222
permissions:
23-
packages: write # Required to delete package versions from GHCR
23+
packages: write # Required to delete package versions from GHCR
2424
steps:
25-
- name: Delete untagged vector images
25+
- name: Delete old dated nightly vector images
2626
uses: actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5.0.0
2727
with:
2828
package-name: vector
2929
package-type: container
30-
min-versions-to-keep: 0
31-
delete-only-untagged-versions: true
32-
continue-on-error: true
30+
min-versions-to-keep: 30
31+
ignore-versions: '^(nightly$|\d+\.\d+)'
3332

34-
- name: Delete old vector-test-runner images
33+
cleanup-test-runner:
34+
runs-on: ubuntu-24.04
35+
permissions:
36+
packages: write # Required to delete package versions from GHCR
37+
steps:
38+
- name: Delete old test-runner images
3539
uses: actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5.0.0
3640
with:
3741
package-name: test-runner
3842
package-type: container
3943
min-versions-to-keep: 5
40-
num-old-versions-to-delete: 50
44+
num-old-versions-to-delete: 100

0 commit comments

Comments
 (0)