Skip to content

Commit 8bd3c96

Browse files
committed
ci: guard against shell injection
1 parent a746c4b commit 8bd3c96

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

scripts/create-github-release.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import fs from 'fs'
33
import path from 'node:path'
44
import { globSync } from 'node:fs'
5-
import { execSync } from 'node:child_process'
5+
import { execSync, execFileSync } from 'node:child_process'
66
import { tmpdir } from 'node:os'
77

88
const rootDir = path.join(import.meta.dirname, '..')
@@ -80,8 +80,9 @@ for (const relPath of allPkgJsonPaths) {
8080
// Get the version from the previous release commit
8181
if (previousRelease) {
8282
try {
83-
const prevContent = execSync(
84-
`git show ${previousRelease}:packages/${relPath}`,
83+
const prevContent = execFileSync(
84+
'git',
85+
['show', `${previousRelease}:packages/${relPath}`],
8586
{ encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] },
8687
)
8788
const prevPkg = JSON.parse(prevContent)

0 commit comments

Comments
 (0)