From d45ef20daec93cc990c9d69e575667424acdbaf0 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Thu, 11 Jul 2024 14:01:08 -0700 Subject: [PATCH] Move ghcr cleanup to start --- action.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/action.yml b/action.yml index 1d4ef7e..ec3fe47 100644 --- a/action.yml +++ b/action.yml @@ -58,6 +58,16 @@ outputs: runs: using: composite steps: + # Cleanup if inputs.keep_versions provided + - name: GHCR Cleanup + if: ${{ inputs.keep_versions }} + uses: actions/delete-package-versions@v5.0.0 + with: + package-name: "${{ github.event.repository.name }}/${{ inputs.package }}" + package-type: "container" + min-versions-to-keep: ${{ inputs.keep_versions }} + ignore-versions: "${{ inputs.keep_regex }}" + # Process variables and inputs - id: vars shell: bash @@ -160,16 +170,6 @@ runs: cache-to: type=gha,mode=max build-args: ${{ inputs.build_args }} - # Cleanup if inputs.keep_versions provided - - name: GHCR Cleanup - if: ${{ inputs.keep_versions }} - uses: actions/delete-package-versions@v5.0.0 - with: - package-name: "${{ github.event.repository.name }}/${{ inputs.package }}" - package-type: "container" - min-versions-to-keep: ${{ inputs.keep_versions }} - ignore-versions: "${{ inputs.keep_regex }}" - # Action repo needs to be present for cleanup/tests - name: Checkout local repo to make sure action.yml is present if: ${{ github.repository }} != ${{ inputs.repository }}