Compare commits

...

4 Commits

Author SHA1 Message Date
itchyny
82970b7de3
Merge 5cdbd5c7ec into 5656298164 2026-02-26 11:33:01 +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
itchyny
5cdbd5c7ec Avoid re-evaluation of the key input in restore implementation 2024-10-06 08:41:39 +09:00
4 changed files with 5 additions and 9 deletions

View File

@ -46276,7 +46276,7 @@ function restoreImpl(stateProvider, earlyExit) {
} }
// Store the matched cache key in states // Store the matched cache key in states
stateProvider.setState(constants_1.State.CacheMatchedKey, cacheKey); stateProvider.setState(constants_1.State.CacheMatchedKey, cacheKey);
const isExactKeyMatch = utils.isExactKeyMatch(core.getInput(constants_1.Inputs.Key, { required: true }), cacheKey); const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
core.setOutput(constants_1.Outputs.CacheHit, isExactKeyMatch.toString()); core.setOutput(constants_1.Outputs.CacheHit, isExactKeyMatch.toString());
if (lookupOnly) { if (lookupOnly) {
core.info(`Cache found and can be restored from key: ${cacheKey}`); core.info(`Cache found and can be restored from key: ${cacheKey}`);

View File

@ -46276,7 +46276,7 @@ function restoreImpl(stateProvider, earlyExit) {
} }
// Store the matched cache key in states // Store the matched cache key in states
stateProvider.setState(constants_1.State.CacheMatchedKey, cacheKey); stateProvider.setState(constants_1.State.CacheMatchedKey, cacheKey);
const isExactKeyMatch = utils.isExactKeyMatch(core.getInput(constants_1.Inputs.Key, { required: true }), cacheKey); const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
core.setOutput(constants_1.Outputs.CacheHit, isExactKeyMatch.toString()); core.setOutput(constants_1.Outputs.CacheHit, isExactKeyMatch.toString());
if (lookupOnly) { if (lookupOnly) {
core.info(`Cache found and can be restored from key: ${cacheKey}`); core.info(`Cache found and can be restored from key: ${cacheKey}`);

View File

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

View File

@ -71,11 +71,7 @@ export async function restoreImpl(
// Store the matched cache key in states // Store the matched cache key in states
stateProvider.setState(State.CacheMatchedKey, cacheKey); stateProvider.setState(State.CacheMatchedKey, cacheKey);
const isExactKeyMatch = utils.isExactKeyMatch( const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
core.getInput(Inputs.Key, { required: true }),
cacheKey
);
core.setOutput(Outputs.CacheHit, isExactKeyMatch.toString()); core.setOutput(Outputs.CacheHit, isExactKeyMatch.toString());
if (lookupOnly) { if (lookupOnly) {
core.info(`Cache found and can be restored from key: ${cacheKey}`); core.info(`Cache found and can be restored from key: ${cacheKey}`);