From 4203354a33c1e1948a89c6cc557b7f8de94b71fa Mon Sep 17 00:00:00 2001
From: Kevin Stillhammer <kevin.stillhammer@gmail.com>
Date: Sat, 24 Aug 2024 09:14:37 +0200
Subject: [PATCH] Compute correct cacheDependencyPathHash

---
 dist/save-cache/index.js   | 4 ++--
 dist/setup/index.js        | 4 ++--
 src/cache/restore-cache.ts | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dist/save-cache/index.js b/dist/save-cache/index.js
index 22a95c5..5f1f30a 100644
--- a/dist/save-cache/index.js
+++ b/dist/save-cache/index.js
@@ -82798,7 +82798,6 @@ const platforms_1 = __nccwpck_require__(6005);
 exports.STATE_CACHE_KEY = 'cache-key';
 exports.STATE_CACHE_MATCHED_KEY = 'cache-matched-key';
 const CACHE_VERSION = '1';
-const fullCacheDependencyGlob = `${process.env['GITHUB_WORKSPACE']}${path_1.default.sep}${inputs_1.cacheDependencyGlob}`;
 function restoreCache(version) {
     return __awaiter(this, void 0, void 0, function* () {
         const cacheKey = yield computeKeys(version);
@@ -82821,7 +82820,8 @@ exports.restoreCache = restoreCache;
 function computeKeys(version) {
     return __awaiter(this, void 0, void 0, function* () {
         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);
             if (cacheDependencyPathHash === '-') {
                 throw new Error(`No file in ${process.cwd()} matched to [${inputs_1.cacheDependencyGlob}], make sure you have checked out the target repository`);
diff --git a/dist/setup/index.js b/dist/setup/index.js
index 2661774..51b882c 100644
--- a/dist/setup/index.js
+++ b/dist/setup/index.js
@@ -83695,7 +83695,6 @@ const platforms_1 = __nccwpck_require__(6005);
 exports.STATE_CACHE_KEY = 'cache-key';
 exports.STATE_CACHE_MATCHED_KEY = 'cache-matched-key';
 const CACHE_VERSION = '1';
-const fullCacheDependencyGlob = `${process.env['GITHUB_WORKSPACE']}${path_1.default.sep}${inputs_1.cacheDependencyGlob}`;
 function restoreCache(version) {
     return __awaiter(this, void 0, void 0, function* () {
         const cacheKey = yield computeKeys(version);
@@ -83718,7 +83717,8 @@ exports.restoreCache = restoreCache;
 function computeKeys(version) {
     return __awaiter(this, void 0, void 0, function* () {
         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);
             if (cacheDependencyPathHash === '-') {
                 throw new Error(`No file in ${process.cwd()} matched to [${inputs_1.cacheDependencyGlob}], make sure you have checked out the target repository`);
diff --git a/src/cache/restore-cache.ts b/src/cache/restore-cache.ts
index c922d54..51aeefc 100644
--- a/src/cache/restore-cache.ts
+++ b/src/cache/restore-cache.ts
@@ -8,7 +8,6 @@ import {getArch, getPlatform} from '../utils/platforms'
 export const STATE_CACHE_KEY = 'cache-key'
 export const STATE_CACHE_MATCHED_KEY = 'cache-matched-key'
 const CACHE_VERSION = '1'
-const fullCacheDependencyGlob = `${process.env['GITHUB_WORKSPACE']}${path.sep}${cacheDependencyGlob}`
 
 export async function restoreCache(version: string): Promise<void> {
   const cacheKey = await computeKeys(version)
@@ -33,7 +32,8 @@ export async function restoreCache(version: string): Promise<void> {
 
 async function computeKeys(version: string): Promise<string> {
   let cacheDependencyPathHash = '-'
-  if (fullCacheDependencyGlob !== '') {
+  if (cacheDependencyGlob !== '') {
+    const fullCacheDependencyGlob = `${process.env['GITHUB_WORKSPACE']}${path.sep}${cacheDependencyGlob}`
     cacheDependencyPathHash += await glob.hashFiles(fullCacheDependencyGlob)
     if (cacheDependencyPathHash === '-') {
       throw new Error(