Skip to content

Commit

Permalink
remove leading "-" on empty cache prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed Feb 8, 2024
1 parent 6a2dae8 commit 262ab51
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions dist/save-cache/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/save-cache/index.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/setup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/setup/index.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/restore-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ async function computeKeys(
? `-${crypto.createHash('sha256').update(workingDir).digest('hex')}`
: ''
const osInfo = await getLinuxInfo()
const primaryKey = `${cachePrefix}-setup-rye-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName}-rye-${version}${workingDirHash}-${dependencyPathHash}`
const restoreKey = `${cachePrefix}-setup-rye-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName}-rye-${version}${workingDirHash}`
const prefix = cachePrefix ? `${cachePrefix}-` : ''
const primaryKey = `${prefix}setup-rye-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName}-rye-${version}${workingDirHash}-${dependencyPathHash}`
const restoreKey = `${prefix}setup-rye-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName}-rye-${version}${workingDirHash}`
return {primaryKey, restoreKey}
}

Expand Down

0 comments on commit 262ab51

Please sign in to comment.