File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4040 run : |
4141 # Run semantic-release with dry-run to detect version
42- NEXT_VERSION=$(npx semantic-release --dry-run --verify-conditions false | tee /dev/stderr | awk '/The next release version is/{print $NF}')
42+ set -o pipefail
43+ if ! OUTPUT=$(npx semantic-release --dry-run --verify-conditions false --verify-release false 2>&1); then
44+ echo "$OUTPUT"
45+ echo "::error::semantic-release failed during version detection"
46+ exit 1
47+ fi
48+ echo "$OUTPUT"
49+ NEXT_VERSION=$(echo "$OUTPUT" | awk '/The next release version is/{print $NF}')
4350 echo "next=$NEXT_VERSION" >> $GITHUB_OUTPUT
4451
4552 - name : Update package.json
4855 env :
4956 NEXT_VERSION : ${{ steps.version.outputs.next }}
5057
58+ - name : Update CHANGELOG.md
59+ if : steps.version.outputs.next != ''
60+ run : npm run update-changelog
61+
5162 - name : Create Pull Request
5263 if : steps.version.outputs.next != ''
5364 uses : peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
6374 **Changes:**
6475 - Updated version in `package.json` to ${{ steps.version.outputs.next }}
6576 - Updated version in `package-lock.json` to ${{ steps.version.outputs.next }}
77+ - Updated `CHANGELOG.md` with release notes
6678
6779 **Next Steps:**
6880 Review and merge this PR to trigger the publish workflow.
Original file line number Diff line number Diff line change 55 "@commitlint/cli" : " ^20.3.1" ,
66 "@commitlint/config-conventional" : " ^20.3.1" ,
77 "@semantic-release/exec" : " ^7.0.3" ,
8+ "conventional-changelog" : " ^7.2.1" ,
89 "conventional-changelog-conventionalcommits" : " ^9.3.0" ,
910 "husky" : " ^9.1.7" ,
1011 "mocha" : " ^7.1.2" ,
3536 ],
3637 "scripts" : {
3738 "test" : " mocha" ,
38- "prepare" : " husky"
39+ "prepare" : " husky" ,
40+ "update-changelog" : " node ./node_modules/conventional-changelog/dist/cli/index.js -p conventionalcommits -i CHANGELOG.md"
3941 }
4042}
You can’t perform that action at this time.
0 commit comments