From fb7cefffd861bb7305fcaf547396352fc344966b Mon Sep 17 00:00:00 2001 From: "Jordan K. Wilson" Date: Mon, 19 Oct 2026 10:34:24 +1300 Subject: [PATCH 1/2] nfc: fix yaml indentation in reusable-clean-containers Formatting --- .../workflows/reusable-clean-containers.yml | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/reusable-clean-containers.yml b/.github/workflows/reusable-clean-containers.yml index cda932e4..a1408ef9 100644 --- a/.github/workflows/reusable-clean-containers.yml +++ b/.github/workflows/reusable-clean-containers.yml @@ -1,24 +1,24 @@ name: Reusable container image cleanup on: workflow_call: - inputs: - package-name: - type: string - required: true - description: | - name of package/container to remove - starts with repository name e.g. base-images/centos - ignored-regex: - type: string - required: true - description: | - regex which is applied against image tags to ignore/keep those versions - number-kept: - type: number - required: true - default: 3 - description: | - number of untagged versions to keep in package history + inputs: + package-name: + type: string + required: true + description: | + name of package/container to remove + starts with repository name e.g. base-images/centos + ignored-regex: + type: string + required: true + description: | + regex which is applied against image tags to ignore/keep those versions + number-kept: + type: number + required: true + default: 3 + description: | + number of untagged versions to keep in package history jobs: clean: runs-on: ubuntu-latest @@ -29,8 +29,8 @@ jobs: exit 1 - uses: actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 #v5.0.0 with: - # Can be a single package version id, or a comma separated list of package version ids. - # Defaults to an empty string. + # Can be a single package version id, or a comma separated list of package version ids. + # Defaults to an empty string. ignore-versions: ${{ inputs.ignored-regex }} # Owner of the package. # Defaults to the owner of the repo executing the workflow. From 28fbbb040afddaf5caa55c472d8bd6f16a014afc Mon Sep 17 00:00:00 2001 From: "Jordan K. Wilson" Date: Mon, 19 Oct 2026 10:34:24 +1300 Subject: [PATCH 2/2] fix: regex should not be required This workflow is a thin wrapper around `delete-package-versions`. Use of regex input should reflect the varible it wraps (`ignore-versions` is optional). --- .github/workflows/reusable-clean-containers.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-clean-containers.yml b/.github/workflows/reusable-clean-containers.yml index a1408ef9..2e514bed 100644 --- a/.github/workflows/reusable-clean-containers.yml +++ b/.github/workflows/reusable-clean-containers.yml @@ -10,9 +10,10 @@ on: starts with repository name e.g. base-images/centos ignored-regex: type: string - required: true + required: false + default: "^$" description: | - regex which is applied against image tags to ignore/keep those versions + optional regex which is applied against image name. The default matches nothing, so no versions are ignored number-kept: type: number required: true