From 3c74c69ea29cd8371ecb41941d4fe26f57742a0d Mon Sep 17 00:00:00 2001 From: Ruben Nijveld Date: Sun, 7 Apr 2024 20:53:17 +0200 Subject: [PATCH] WIP container cleanup script --- .github/workflows/container-cleanup.yml | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/container-cleanup.yml diff --git a/.github/workflows/container-cleanup.yml b/.github/workflows/container-cleanup.yml new file mode 100644 index 0000000..588eddc --- /dev/null +++ b/.github/workflows/container-cleanup.yml @@ -0,0 +1,26 @@ +name: Container Cleanup + +permissions: + contents: read + +on: + pull_request: + +jobs: + cleanup: + runs-on: ubuntu-latest + steps: + - name: Get a list of tagged docker images + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea + with: + script: | + const versions = await github.rest.packages.getAllPackageVersionsForPackageOwnedByOrg({ + package_type: 'container', + package_name: 'debian', + org: context.repo.owner, + per_page: 100, + state: 'active', + }); + for (const p of versions.data) { + console.log(p.metadata); + }