mirror of
https://github.com/hanzoai/node-jsonwebtoken.git
synced 2026-09-24 17:00:48 +00:00
ci: replace npx changelog call with npm script and fix prepare-release workflow (#1037)
This commit is contained in:
@@ -38,7 +38,14 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Run semantic-release with dry-run to detect version
|
||||
NEXT_VERSION=$(npx semantic-release --dry-run --verify-conditions false | tee /dev/stderr | awk '/The next release version is/{print $NF}')
|
||||
set -o pipefail
|
||||
if ! OUTPUT=$(npx semantic-release --dry-run --verify-conditions false --verify-release false 2>&1); then
|
||||
echo "$OUTPUT"
|
||||
echo "::error::semantic-release failed during version detection"
|
||||
exit 1
|
||||
fi
|
||||
echo "$OUTPUT"
|
||||
NEXT_VERSION=$(echo "$OUTPUT" | awk '/The next release version is/{print $NF}')
|
||||
echo "next=$NEXT_VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Update package.json
|
||||
@@ -49,7 +56,7 @@ jobs:
|
||||
|
||||
- name: Update CHANGELOG.md
|
||||
if: steps.version.outputs.next != ''
|
||||
run: npx conventional-changelog-cli -p conventionalcommits -i CHANGELOG.md -s
|
||||
run: npm run update-changelog
|
||||
|
||||
- name: Create Pull Request
|
||||
if: steps.version.outputs.next != ''
|
||||
|
||||
+3
-2
@@ -22,7 +22,8 @@
|
||||
"lint": "eslint .",
|
||||
"coverage": "nyc mocha --use_strict",
|
||||
"test": "mocha",
|
||||
"prepare": "husky"
|
||||
"prepare": "husky",
|
||||
"update-changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -54,7 +55,7 @@
|
||||
"@semantic-release/exec": "^7.0.3",
|
||||
"atob": "^2.1.2",
|
||||
"chai": "^4.1.2",
|
||||
"conventional-changelog": "~1.1.0",
|
||||
"conventional-changelog": "^7.2.1",
|
||||
"conventional-changelog-conventionalcommits": "^9.3.0",
|
||||
"eslint": "^4.19.1",
|
||||
"husky": "^9.1.7",
|
||||
|
||||
Reference in New Issue
Block a user