From 75e1ef85dfecac63a602e482ca10f930bae147e1 Mon Sep 17 00:00:00 2001 From: Samuel Salazar Date: Tue, 23 Jun 2026 16:22:56 -0400 Subject: [PATCH] ci: skip verifyRelease in prepare-release dry-run and add changelog --- .github/workflows/prepare-release.yml | 14 +++++++++++++- package.json | 4 +++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 5c5eac8..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 @@ -47,6 +54,10 @@ jobs: env: NEXT_VERSION: ${{ steps.version.outputs.next }} + - name: Update CHANGELOG.md + if: steps.version.outputs.next != '' + run: npm run update-changelog + - name: Create Pull Request if: steps.version.outputs.next != '' uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 @@ -61,6 +72,7 @@ jobs: **Changes:** - Updated version in `package.json` to ${{ steps.version.outputs.next }} + - Updated `CHANGELOG.md` with release notes **Next Steps:** Review and merge this PR to trigger the publish workflow. diff --git a/package.json b/package.json index 6f614d6..0b879bc 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@commitlint/cli": "^20.3.1", "@commitlint/config-conventional": "^20.3.1", "@semantic-release/exec": "^7.0.3", + "conventional-changelog": "^7.2.1", "conventional-changelog-conventionalcommits": "^9.3.0", "base64url": "^2.0.0", "husky": "^9.1.7", @@ -30,7 +31,8 @@ }, "scripts": { "prepare": "husky", - "test": "make test" + "test": "make test", + "update-changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md" }, "repository": { "type": "git",