Skip to content

Commit c3abd17

Browse files
fix: replace
1 parent 637e2b7 commit c3abd17

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ try {
88
const lockPath = core.getInput('packageLockJSON')
99
const jsonPackageFile = JSON.parse(fs.readFileSync(path.resolve(process.env.GITHUB_WORKSPACE, packagePath || 'package.json')))
1010
const regexp = new RegExp(`"name":"${jsonPackageFile.name}","version":".*?",`, 'g')
11-
const jsonLockFile = JSON.parse(fs.readFileSync(path.resolve(process.env.GITHUB_WORKSPACE, lockPath || 'package-lock.json')))
12-
.toString()
13-
.replace(/\n|\s|\r|\t/g, '')
14-
.replace(regexp, '')
11+
const jsonLockFile = fs.readFileSync(path.resolve(process.env.GITHUB_WORKSPACE, lockPath || 'package-lock.json')).replace(/\n|\s|\r|\t/g, '').replace(regexp, '')
1512

1613
core.setOutput('cacheKey', crypto.createHash('sha256').update(jsonLockFile, 'utf8').digest('hex'));
1714
} catch (error) {

0 commit comments

Comments
 (0)