Skip to content

Commit abae22b

Browse files
committed
fix(ci): read package version safely in publish workflow
1 parent 2dfa083 commit abae22b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ jobs:
3333
- id: pkg
3434
name: Read Package Version
3535
run: |
36-
echo "name=$(node -p \"require('./package.json').name\")" >> $GITHUB_OUTPUT
37-
echo "version=$(node -p \"require('./package.json').version\")" >> $GITHUB_OUTPUT
36+
node <<'EOF' >> "$GITHUB_OUTPUT"
37+
const pkg = require('./package.json')
38+
console.log(`name=${pkg.name}`)
39+
console.log(`version=${pkg.version}`)
40+
EOF
3841
3942
- id: version-cache
4043
name: Restore Version Cache

0 commit comments

Comments
 (0)