From aae28941931192c0d233df119e2607fabf59a8eb Mon Sep 17 00:00:00 2001 From: Samuel Salazar Date: Tue, 23 Jun 2026 16:18:24 -0400 Subject: [PATCH] ci: replace npx changelog call with npm script and fix prepare-release workflow --- .github/workflows/prepare-release.yml | 11 +++++++++-- package.json | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 357e8dee..6bdd95a7 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -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 != '' diff --git a/package.json b/package.json index 68fa19fe..01885308 100644 --- a/package.json +++ b/package.json @@ -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",