Skip to content

Commit 37a0d6e

Browse files
committed
Do extend PATH and set MSYSTEM, even after restoring from cache
Due to a bug, the PATH and MSYSTEM environment variables were set appropriately only when we could not restore the artifact from the cache. Let's fix this. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 098bf8d commit 37a0d6e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

main.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,27 @@ async function run(): Promise<void> {
2929
useCache = false
3030
}
3131

32+
let needToDownload = true
3233
try {
3334
if (useCache && (await restoreCache([outputDirectory], id))) {
3435
core.info(`Cached ${id} was successfully restored`)
35-
return
36+
needToDownload = false
3637
}
3738
} catch (e) {
3839
core.warning(`Cannot use @actions/cache (${e})`)
3940
useCache = false
4041
}
4142

42-
core.info(`Downloading ${artifactName}`)
43-
await download(
44-
outputDirectory,
45-
verbose.match(/^\d+$/) ? parseInt(verbose) : verbose === 'true'
46-
)
43+
if (needToDownload) {
44+
core.info(`Downloading ${artifactName}`)
45+
await download(
46+
outputDirectory,
47+
verbose.match(/^\d+$/) ? parseInt(verbose) : verbose === 'true'
48+
)
4749

48-
if (useCache && !(await saveCache([outputDirectory], id))) {
49-
core.warning(`Failed to cache ${id}`)
50+
if (useCache && !(await saveCache([outputDirectory], id))) {
51+
core.warning(`Failed to cache ${id}`)
52+
}
5053
}
5154

5255
// Set up PATH so that Git for Windows' SDK's `bash.exe` is found

0 commit comments

Comments
 (0)