Skip to content

Commit 03e433f

Browse files
committed
Action
1 parent 29fa357 commit 03e433f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ jobs:
2727
run: |
2828
# Extract the version from the git tag (e.g., "v1.0.0")
2929
version=$(echo "${{ github.ref }}" | sed -e 's/^refs\/tags\/v//')
30-
31-
# Update the package.json version
32-
npm version "$version"
30+
31+
# Update the package.json version using Node.js script
32+
node - <<EOF
33+
const fs = require('fs');
34+
const packageJson = JSON.parse(fs.readFileSync('package.json'));
35+
packageJson.version = "$version";
36+
fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2));
37+
EOF
3338
3439
- uses: pnpm/action-setup@v2
3540
name: Install pnpm

0 commit comments

Comments
 (0)