From 946776e670ae95f34c7ef929417ea5a96efb998d Mon Sep 17 00:00:00 2001 From: Pascal Roeleven Date: Mon, 6 Mar 2023 15:56:37 +0100 Subject: [PATCH] Clean cache directory after use (#95) --- action.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f24f2bb..0cc2470 100644 --- a/action.yml +++ b/action.yml @@ -59,7 +59,7 @@ runs: PACKAGES: "${{ inputs.packages }}" - id: load-cache - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ~/cache-apt-pkgs key: cache-apt-pkgs_${{ env.CACHE_KEY }} @@ -83,6 +83,18 @@ runs: DEBUG: "${{ inputs.debug }}" PACKAGES: "${{ inputs.packages }}" + - id: save-cache + if: ${{ ! steps.load-cache.outputs.cache-hit }} + uses: actions/cache/save@v3 + with: + path: ~/cache-apt-pkgs + key: ${{ steps.load-cache.outputs.cache-primary-key }} + + - id: clean-cache + run: | + rm -rf ~/cache-apt-pkgs + shell: bash + - id: upload-logs if: ${{ inputs.debug == 'true' }} uses: actions/upload-artifact@v3