diff --git a/.github/workflows/reusable-clean-containers.yml b/.github/workflows/reusable-clean-containers.yml index cda932e..2e514be 100644 --- a/.github/workflows/reusable-clean-containers.yml +++ b/.github/workflows/reusable-clean-containers.yml @@ -1,24 +1,25 @@ 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: false + default: "^$" + description: | + optional regex which is applied against image name. The default matches nothing, so no versions are ignored + 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 +30,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.