harden cache usage
This commit is contained in:
@@ -33,8 +33,9 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: echo "dir=$(bun pm cache)" >> "$GITHUB_OUTPUT"
|
run: echo "dir=$(bun pm cache)" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Cache Bun dependencies
|
- name: Restore Bun dependencies
|
||||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
id: bun-cache
|
||||||
|
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.cache.outputs.dir }}
|
path: ${{ steps.cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
|
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
|
||||||
@@ -56,3 +57,10 @@ runs:
|
|||||||
bun install ${{ inputs.install-flags }}
|
bun install ${{ inputs.install-flags }}
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Save Bun dependencies
|
||||||
|
if: steps.bun-cache.outputs.cache-hit != 'true' && github.event_name != 'pull_request' && github.event_name != 'pull_request_target'
|
||||||
|
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||||
|
with:
|
||||||
|
path: ${{ steps.cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
|
||||||
|
|||||||
Reference in New Issue
Block a user