GeezerVison is showing github.com — harden cache usage · kpiwko/opencode@1d243ce
File tree
Expand file treeCollapse file tree
Open diff view settings
.github/actions/setup-bun
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/actions/setup-bun/action.yml +10-2Lines changed: 10 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
33 | 33 | shell: bash |
34 | 34 | run: echo "dir=$(bun pm cache)" >> "$GITHUB_OUTPUT" |
35 | 35 |
|
36 | | - - name: Cache Bun dependencies |
37 | | - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 36 | + - name: Restore Bun dependencies |
| 37 | + id: bun-cache |
| 38 | + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
38 | 39 | with: |
39 | 40 | path: ${{ steps.cache.outputs.dir }} |
40 | 41 | key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} |
|
56 | 57 | bun install ${{ inputs.install-flags }} |
57 | 58 | fi |
58 | 59 | shell: bash |
| 60 | + |
| 61 | + - name: Save Bun dependencies |
| 62 | + if: steps.bun-cache.outputs.cache-hit != 'true' && github.event_name != 'pull_request' && github.event_name != 'pull_request_target' |
| 63 | + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 64 | + with: |
| 65 | + path: ${{ steps.cache.outputs.dir }} |
| 66 | + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} |