Compute correct cacheDependencyPathHash

This commit is contained in:
Kevin Stillhammer 2024-08-24 09:14:37 +02:00
parent e4c1a1723b
commit 4203354a33
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

4
dist/save-cache/index.js generated vendored
View File

@ -82798,7 +82798,6 @@ const platforms_1 = __nccwpck_require__(6005);
exports.STATE_CACHE_KEY = 'cache-key'; exports.STATE_CACHE_KEY = 'cache-key';
exports.STATE_CACHE_MATCHED_KEY = 'cache-matched-key'; exports.STATE_CACHE_MATCHED_KEY = 'cache-matched-key';
const CACHE_VERSION = '1'; const CACHE_VERSION = '1';
const fullCacheDependencyGlob = `${process.env['GITHUB_WORKSPACE']}${path_1.default.sep}${inputs_1.cacheDependencyGlob}`;
function restoreCache(version) { function restoreCache(version) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const cacheKey = yield computeKeys(version); const cacheKey = yield computeKeys(version);
@ -82821,7 +82820,8 @@ exports.restoreCache = restoreCache;
function computeKeys(version) { function computeKeys(version) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let cacheDependencyPathHash = '-'; let cacheDependencyPathHash = '-';
if (fullCacheDependencyGlob !== '') { if (inputs_1.cacheDependencyGlob !== '') {
const fullCacheDependencyGlob = `${process.env['GITHUB_WORKSPACE']}${path_1.default.sep}${inputs_1.cacheDependencyGlob}`;
cacheDependencyPathHash += yield glob.hashFiles(fullCacheDependencyGlob); cacheDependencyPathHash += yield glob.hashFiles(fullCacheDependencyGlob);
if (cacheDependencyPathHash === '-') { if (cacheDependencyPathHash === '-') {
throw new Error(`No file in ${process.cwd()} matched to [${inputs_1.cacheDependencyGlob}], make sure you have checked out the target repository`); throw new Error(`No file in ${process.cwd()} matched to [${inputs_1.cacheDependencyGlob}], make sure you have checked out the target repository`);

4
dist/setup/index.js generated vendored
View File

@ -83695,7 +83695,6 @@ const platforms_1 = __nccwpck_require__(6005);
exports.STATE_CACHE_KEY = 'cache-key'; exports.STATE_CACHE_KEY = 'cache-key';
exports.STATE_CACHE_MATCHED_KEY = 'cache-matched-key'; exports.STATE_CACHE_MATCHED_KEY = 'cache-matched-key';
const CACHE_VERSION = '1'; const CACHE_VERSION = '1';
const fullCacheDependencyGlob = `${process.env['GITHUB_WORKSPACE']}${path_1.default.sep}${inputs_1.cacheDependencyGlob}`;
function restoreCache(version) { function restoreCache(version) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const cacheKey = yield computeKeys(version); const cacheKey = yield computeKeys(version);
@ -83718,7 +83717,8 @@ exports.restoreCache = restoreCache;
function computeKeys(version) { function computeKeys(version) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let cacheDependencyPathHash = '-'; let cacheDependencyPathHash = '-';
if (fullCacheDependencyGlob !== '') { if (inputs_1.cacheDependencyGlob !== '') {
const fullCacheDependencyGlob = `${process.env['GITHUB_WORKSPACE']}${path_1.default.sep}${inputs_1.cacheDependencyGlob}`;
cacheDependencyPathHash += yield glob.hashFiles(fullCacheDependencyGlob); cacheDependencyPathHash += yield glob.hashFiles(fullCacheDependencyGlob);
if (cacheDependencyPathHash === '-') { if (cacheDependencyPathHash === '-') {
throw new Error(`No file in ${process.cwd()} matched to [${inputs_1.cacheDependencyGlob}], make sure you have checked out the target repository`); throw new Error(`No file in ${process.cwd()} matched to [${inputs_1.cacheDependencyGlob}], make sure you have checked out the target repository`);

View File

@ -8,7 +8,6 @@ import {getArch, getPlatform} from '../utils/platforms'
export const STATE_CACHE_KEY = 'cache-key' export const STATE_CACHE_KEY = 'cache-key'
export const STATE_CACHE_MATCHED_KEY = 'cache-matched-key' export const STATE_CACHE_MATCHED_KEY = 'cache-matched-key'
const CACHE_VERSION = '1' const CACHE_VERSION = '1'
const fullCacheDependencyGlob = `${process.env['GITHUB_WORKSPACE']}${path.sep}${cacheDependencyGlob}`
export async function restoreCache(version: string): Promise<void> { export async function restoreCache(version: string): Promise<void> {
const cacheKey = await computeKeys(version) const cacheKey = await computeKeys(version)
@ -33,7 +32,8 @@ export async function restoreCache(version: string): Promise<void> {
async function computeKeys(version: string): Promise<string> { async function computeKeys(version: string): Promise<string> {
let cacheDependencyPathHash = '-' let cacheDependencyPathHash = '-'
if (fullCacheDependencyGlob !== '') { if (cacheDependencyGlob !== '') {
const fullCacheDependencyGlob = `${process.env['GITHUB_WORKSPACE']}${path.sep}${cacheDependencyGlob}`
cacheDependencyPathHash += await glob.hashFiles(fullCacheDependencyGlob) cacheDependencyPathHash += await glob.hashFiles(fullCacheDependencyGlob)
if (cacheDependencyPathHash === '-') { if (cacheDependencyPathHash === '-') {
throw new Error( throw new Error(