Skip to content

Commit

Permalink
Update save-cache and restore-cache actions 11/06/2024 | 24w45a3
Browse files Browse the repository at this point in the history
  • Loading branch information
GamesTrap committed Nov 6, 2024
1 parent c33270d commit 351be9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/composite/restore-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ runs:
run: |
echo "TARGET_PATH=${{ github.event.repository.name }}/cache/${{inputs.key}}.7z" >> "$GITHUB_OUTPUT"
- name: Check cache (Linux)
shell: bash -e {0}
shell: bash +e {0}
id: check-cache-linux
if: runner.os == 'Linux'
run: |
set +e
sudo apt install -y smbclient
if smbclient //${{inputs.server-hostname}}/${{inputs.server-share}} -U ${{inputs.server-username}}%${{inputs.server-password}} -c 'ls "${{steps.build-dest-path.outputs.TARGET_PATH}}"' 2>/dev/null | grep -q "${{steps.build-dest-path.outputs.TARGET_PATH}}"; then
echo "CACHE_HIT=true" >> "$GITHUB_OUTPUT"
else
echo "CACHE_HIT=false" >> "$GITHUB_OUTPUT"
fi
exit "0"
- name: Check cache (Windows)
id: check-cache-windows
shell: powershell
Expand Down
6 changes: 3 additions & 3 deletions .github/composite/save-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ runs:
echo "TARGET_PATH=${{ github.event.repository.name }}/cache/${{inputs.key}}.7z" >> "$GITHUB_OUTPUT"
echo "TARGET_FOLDER_PATH=${{ github.event.repository.name }}/cache" >> "$GITHUB_OUTPUT"
- name: Check cache (Linux)
shell: bash -e {0}
shell: bash +e {0}
id: check-cache-linux
if: runner.os == 'Linux'
run: |
set +e
sudo apt install -y smbclient
if smbclient //${{inputs.server-hostname}}/${{inputs.server-share}} -U ${{inputs.server-username}}%${{inputs.server-password}} -c 'ls "${{steps.build-dest-path.outputs.TARGET_PATH}}"' 2>/dev/null | grep -q "${{steps.build-dest-path.outputs.TARGET_PATH}}"; then
if [ smbclient //${{inputs.server-hostname}}/${{inputs.server-share}} -U ${{inputs.server-username}}%${{inputs.server-password}} -c 'ls "${{steps.build-dest-path.outputs.TARGET_PATH}}"' 2>/dev/null | grep -q "${{steps.build-dest-path.outputs.TARGET_PATH}}" ]; then
echo "CACHE_HIT=true" >> "$GITHUB_OUTPUT"
else
echo "CACHE_HIT=false" >> "$GITHUB_OUTPUT"
fi
exit "0"
- name: Check cache (Windows)
id: check-cache-windows
shell: powershell
Expand Down

0 comments on commit 351be9a

Please sign in to comment.