From a464a478df5a99f26c4f092b51590e739b890cc0 Mon Sep 17 00:00:00 2001 From: Jacob Wujciak-Jens Date: Mon, 19 Feb 2024 23:55:43 +0100 Subject: [PATCH] use gh for cross workflow again --- restore/action.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/restore/action.yml b/restore/action.yml index cc5fb76..92f77fe 100644 --- a/restore/action.yml +++ b/restore/action.yml @@ -77,11 +77,20 @@ runs: else echo "::warning :: No stash found for key: ${{ inputs.key }}" fi + - name: Download Stash from other workflow run + shell: bash + if: ${{ ! steps.check-stash.outputs.stash_exists == 'false' && steps.cross-repo.outputs.stash_name != ''}} + env: + GH_TOKEN: "${{ inputs.token }}" + STASH_NAME: "${{ steps.cross-repo.outputs.stash_name }}" + STASH_RUN_ID: "${{ steps.cross-repo.outputs.stash_run_id }}" + run: | + gh run download $STASH_RUN_ID --name $STASH_NAME --dir "${{ inputs.path }}" - - name: Download Stash + - name: Download Stash from current workflow run + if: ${{ steps.check-stash.outputs.stash_exists == 'true' }} uses: actions/download-artifact@v4 with: - name: ${{ steps.check-stash.outputs.stash_name || steps.cross-repo.outputs.stash_name || inputs.key }} + name: ${{ steps.check-stash.outputs.stash_name || inputs.key }} path: ${{ inputs.path }} - run-id: ${{ steps.cross-repo.outputs.stash_run_id || github.run_id}}