Skip to content

Commit 6ef1113

Browse files
committed
Run npm run build as suggested
1 parent cbe3ec3 commit 6ef1113

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

dist/setup/index.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73030,7 +73030,7 @@ const path_1 = __importDefault(__nccwpck_require__(1017));
7303073030
const fs_1 = __importDefault(__nccwpck_require__(7147));
7303173031
const constants_1 = __nccwpck_require__(9042);
7303273032
const cache_utils_1 = __nccwpck_require__(1678);
73033-
const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
73033+
const restoreCache = (packageManager, cacheDependencyPath, cacheInvalidateAfterDays) => __awaiter(void 0, void 0, void 0, function* () {
7303473034
const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo(packageManager);
7303573035
if (!packageManagerInfo) {
7303673036
throw new Error(`Caching for '${packageManager}' is not supported`);
@@ -73044,9 +73044,15 @@ const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0,
7304473044
if (!fileHash) {
7304573045
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
7304673046
}
73047-
const keyPrefix = `${platform}-setup-node-`;
73047+
const numericCacheInvalidateAfterDays = cacheInvalidateAfterDays && cacheInvalidateAfterDays === '0'
73048+
? 0
73049+
: (parseInt(cacheInvalidateAfterDays || '', 10) || 120);
73050+
const timedInvalidationPrefix = numericCacheInvalidateAfterDays
73051+
? Math.floor(Date.now() / (1000 * 60 * 60 * 24 * numericCacheInvalidateAfterDays)) % 1000 // % 1000 to get a rolling prefix between 0 and 999 rather than a possibly infinitely large
73052+
: 0;
73053+
const keyPrefix = `${platform}-${timedInvalidationPrefix}-setup-node-`;
7304873054
const primaryKey = `${keyPrefix}${packageManager}-${fileHash}`;
73049-
const restoreKeys = [`${keyPrefix}${packageManager}-`, keyPrefix];
73055+
const restoreKeys = [`${keyPrefix}${packageManager}-`];
7305073056
core.debug(`primary key is ${primaryKey}`);
7305173057
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
7305273058
const cacheKey = yield cache.restoreCache([cachePath], primaryKey, restoreKeys);
@@ -73981,7 +73987,8 @@ function run() {
7398173987
}
7398273988
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
7398373989
const cacheDependencyPath = core.getInput('cache-dependency-path');
73984-
yield cache_restore_1.restoreCache(cache, cacheDependencyPath);
73990+
const cacheInvalidateAfterDays = core.getInput('cache-invalidate-after-days');
73991+
yield cache_restore_1.restoreCache(cache, cacheDependencyPath, cacheInvalidateAfterDays);
7398573992
}
7398673993
const matchersPath = path.join(__dirname, '../..', '.github');
7398773994
core.info(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);

0 commit comments

Comments
 (0)