Compare commits

...

6 Commits

Author SHA1 Message Date
Marcus Boerger
f4d88fbd03
Merge 9365bab5e5 into 5656298164 2026-02-26 11:15:56 +00:00
Ryan Ghadimi
5656298164
Merge pull request #1722 from RyPeck/patch-1
Fix cache key in examples.md for bun.lock
2026-02-24 14:21:04 +00:00
Ryan Peck
4e380d19e1
Fix cache key in examples.md for bun.lock
Updated cache key to use 'bun.lock' instead of 'bun.lockb' for consistency.
2026-02-24 09:11:36 -05:00
Marcus Boerger
9365bab5e5
Update action.yml
Co-authored-by: Kyle Ross <37418852+Rossbro2@users.noreply.github.com>
2025-05-21 21:40:49 +02:00
Marcus Boerger
25ee7a8ae9
Update README.md
Co-authored-by: Kyle Ross <37418852+Rossbro2@users.noreply.github.com>
2025-05-21 21:40:39 +02:00
helly25
40b3745dc1
Add new setting save-on-success.
* Proposal to implement https://github.com/actions/cache/issues/1570
2025-04-25 15:45:16 +02:00
3 changed files with 10 additions and 4 deletions

View File

@ -90,6 +90,7 @@ If you are using a `self-hosted` Windows runner, `GNU tar` and `zstd` are requir
* `enableCrossOsArchive` - An optional boolean when enabled, allows Windows runners to save or restore caches that can be restored or saved respectively on other platforms. Default: `false`
* `fail-on-cache-miss` - Fail the workflow if cache entry is not found. Default: `false`
* `lookup-only` - If true, only checks if cache entry exists and skips download. Does not change save cache behavior. Default: `false`
* `save-on-success` - If true, then the cache is written in the post action on success, or (if false) the cache will only be restored if available. Default: `true`
#### Environment Variables

View File

@ -26,13 +26,18 @@ inputs:
description: 'Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache'
default: 'false'
required: false
save-on-success:
description: 'Whether the cache is written in the post action on success or (if false) is only restored'
default: 'true'
required: false
save-always:
description: 'Run the post step to save the cache even if another step before fails'
default: 'false'
required: false
deprecationMessage: |
save-always does not work as intended and will be removed in a future release.
A separate `actions/cache/restore` step should be used instead.
If you only want to control whether a new cache will be written use `save-on-success` instead.
Otherwise a separate `actions/cache/restore` step should be used instead.
See https://github.com/actions/cache/tree/main/save#always-save-cache for more details.
outputs:
cache-hit:
@ -41,7 +46,7 @@ runs:
using: 'node24'
main: 'dist/restore/index.js'
post: 'dist/save/index.js'
post-if: "success()"
post-if: "success() && github.event.inputs.save-on-success"
branding:
icon: 'archive'
color: 'gray-dark'

View File

@ -49,7 +49,7 @@
with:
path: |
~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
```
### Windows
@ -59,7 +59,7 @@
with:
path: |
~\.bun
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
```
## C# - NuGet