From ff08d7d467c5eb35ffdaed173fc3a33426a328f7 Mon Sep 17 00:00:00 2001 From: Christian Proud Date: Wed, 29 Nov 2023 00:06:28 +0800 Subject: [PATCH] Fix incorrect GitHub actions path on containers (#78) Co-authored-by: Ian Butterworth --- action.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 79dc982..61259fb 100644 --- a/action.yml +++ b/action.yml @@ -96,13 +96,24 @@ runs: # github and actions/cache doesn't provide a way to update a cache at a given key, so we delete any # that match the restore key just before saving the new cache + + # Not windows - uses: pyTooling/Actions/with-post-step@adef08d3bdef092282614f3b683897cefae82ee3 - if: ${{ inputs.delete-old-caches == 'true' }} + if: ${{ inputs.delete-old-caches == 'true' && runner.OS != 'Windows' }} with: # seems like there has to be a `main` step in this action. Could list caches for info if we wanted # main: julia ${{ github.action_path }}/handle_caches.jl "${{ github.repository }}" "list" main: echo "" - post: julia ${{ github.action_path }}/handle_caches.jl "${{ github.repository }}" "rm" "${{ steps.keys.outputs.restore-key }}" + post: julia $GITHUB_ACTION_PATH/handle_caches.jl "${{ github.repository }}" "rm" "${{ steps.keys.outputs.restore-key }}" + env: + GH_TOKEN: ${{ inputs.token }} + + # Windows (because this action uses command prompt on windows) + - uses: pyTooling/Actions/with-post-step@adef08d3bdef092282614f3b683897cefae82ee3 + if: ${{ inputs.delete-old-caches == 'true' && runner.OS == 'Windows' }} + with: + main: echo "" + post: cd %GITHUB_ACTION_PATH% && julia handle_caches.jl "${{ github.repository }}" "rm" "${{ steps.keys.outputs.restore-key }}" env: GH_TOKEN: ${{ inputs.token }}