Fix for Gitea
This commit is contained in:
8
dist/setup/index.js
vendored
8
dist/setup/index.js
vendored
@@ -131801,6 +131801,7 @@ const cache = __importStar(__nccwpck_require__(27799));
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
const glob = __importStar(__nccwpck_require__(28090));
|
||||
const STATE_CACHE_PRIMARY_KEY = 'cache-primary-key';
|
||||
const STATE_CACHE_HIT = 'cache-hit';
|
||||
const CACHE_MATCHED_KEY = 'cache-matched-key';
|
||||
const CACHE_KEY_PREFIX = 'setup-java';
|
||||
const supportedPackageManager = [
|
||||
@@ -131873,7 +131874,7 @@ function computeCacheKey(packageManager, cacheDependencyPath) {
|
||||
if (!fileHash) {
|
||||
throw new Error(`No file in ${process.cwd()} matched to [${pattern}], make sure you have checked out the target repository`);
|
||||
}
|
||||
return `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-${packageManager.id}-${fileHash}`;
|
||||
return `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-ABC-${process.arch}-${packageManager.id}-${fileHash}`;
|
||||
});
|
||||
}
|
||||
/**
|
||||
@@ -131891,7 +131892,7 @@ function restore(id, cacheDependencyPath) {
|
||||
const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey);
|
||||
if (matchedKey) {
|
||||
core.saveState(CACHE_MATCHED_KEY, matchedKey);
|
||||
core.setOutput('cache-hit', matchedKey === primaryKey);
|
||||
core.setOutput('cache-hit', true);
|
||||
core.info(`Cache restored from key: ${matchedKey}`);
|
||||
}
|
||||
else {
|
||||
@@ -131911,11 +131912,12 @@ function save(id) {
|
||||
const matchedKey = core.getState(CACHE_MATCHED_KEY);
|
||||
// Inputs are re-evaluated before the post action, so we want the original key used for restore
|
||||
const primaryKey = core.getState(STATE_CACHE_PRIMARY_KEY);
|
||||
const cacheHit = core.getState(STATE_CACHE_HIT);
|
||||
if (!primaryKey) {
|
||||
core.warning('Error retrieving key from state.');
|
||||
return;
|
||||
}
|
||||
else if (matchedKey === primaryKey) {
|
||||
else if (matchedKey === primaryKey || cacheHit) {
|
||||
// no change in target directories
|
||||
core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user