Skip to content

Commit

Permalink
Make local cache optional
Browse files Browse the repository at this point in the history
- Added 'use-local-cache' option so we can control the use of the local cache
- Also move the file to GitHub cache instead of copying to save space
  • Loading branch information
Jimver committed Jan 6, 2024
1 parent 58517e6 commit a4c23f0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function download(
const osRelease = await getRelease()
const toolId = `${toolName}-${osType}-${osRelease}`
// Path that contains the executable file
let executableDirectory: string | undefined;
let executableDirectory: string | undefined
const cacheKey = `${toolId}-${version}`
const cacheDirectory = cacheKey
if (useLocalCache) {
Expand Down Expand Up @@ -64,8 +64,10 @@ export async function download(
destFileName,
`${toolName}-${osType}`,
`${version}`
)
core.debug(`Cached download to local machine cache at ${localCacheDirectory}`)
)
core.debug(
`Cached download to local machine cache at ${localCacheDirectory}`
)
executableDirectory = localCacheDirectory
}
if (useGitHubCache) {
Expand Down

0 comments on commit a4c23f0

Please sign in to comment.