From aae69ab5173b5cbbb47868d98d5ae195a8916a70 Mon Sep 17 00:00:00 2001 From: Samuel Salazar Date: Tue, 23 Jun 2026 16:17:13 -0400 Subject: [PATCH] ci: replace npx changelog call with npm script and fix prepare-release workflow --- .github/workflows/prepare-release.yml | 11 +++++++++-- package.json | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 357e8de..6bdd95a 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 4f6934e..10d198f 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "test": "./node_modules/.bin/_mocha -R spec --colors", "cover": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- -R spec --colors", "open_cover": "open coverage/lcov-report/*.html", - "prepare": "husky" + "prepare": "husky", + "update-changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md" }, "repository": { "type": "git", @@ -42,6 +43,7 @@ "@commitlint/cli": "^20.3.1", "@commitlint/config-conventional": "^20.3.1", "@semantic-release/exec": "^7.0.3", + "conventional-changelog": "^7.2.1", "body-parser": "^1.15.2", "chai": "^4.2.0", "cheerio": "~0.10.7",