Skip to content

Commit

Permalink
Action
Browse files Browse the repository at this point in the history
  • Loading branch information
npv2k1 committed Jul 6, 2023
1 parent 29fa357 commit 03e433f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ jobs:
run: |
# Extract the version from the git tag (e.g., "v1.0.0")
version=$(echo "${{ github.ref }}" | sed -e 's/^refs\/tags\/v//')
# Update the package.json version
npm version "$version"
# Update the package.json version using Node.js script
node - <<EOF
const fs = require('fs');
const packageJson = JSON.parse(fs.readFileSync('package.json'));
packageJson.version = "$version";
fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2));
EOF
- uses: pnpm/action-setup@v2
name: Install pnpm
Expand Down

0 comments on commit 03e433f

Please sign in to comment.