From a50e955b3e4e8a1c943cfa6c124ed50c6038f2ed Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sat, 9 Mar 2024 05:04:17 -0700 Subject: [PATCH] Add job to delete old images (#10332) --- .github/workflows/stale.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index a9c902f2e..b682012dc 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -24,3 +24,18 @@ jobs: operations-per-run: 120 - name: Print outputs run: echo ${{ join(steps.stale.outputs.*, ',') }} + + clean_ghcr: + name: Delete outdated dev container images + runs-on: ubuntu-latest + steps: + - name: Delete old images + uses: snok/container-retentation-policy@v2 + with: + image-names: dev-* + cut-off: 60 days ago UTC + keep-at-least: 5 + account-type: personal + token: ${{ secrets.GITHUB_TOKEN }} + token-type: github-token +