From 2ebc5e2970cecead5effa54494ad402e3abb09a6 Mon Sep 17 00:00:00 2001 From: Steve Rushby Date: Tue, 12 Nov 2024 12:57:31 +0000 Subject: [PATCH] chore: remove conventional changelog checks for publish, take all commits since last tag --- .github/workflows/ci-publish-package.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-publish-package.yml b/.github/workflows/ci-publish-package.yml index abc10f9..8a81a92 100644 --- a/.github/workflows/ci-publish-package.yml +++ b/.github/workflows/ci-publish-package.yml @@ -37,9 +37,6 @@ jobs: - name: Run build run: npm run build - - name: Run tests - run: npm run test - - name: Extract Package Version id: extract_version run: echo "package_version=$(node -p "require('./package.json').version")" >> $GITHUB_ENV @@ -55,22 +52,18 @@ jobs: git fetch --tags current_tag="v${{ env.package_version }}" - - last_tag=$(git tag --sort=-creatordate | grep -B1 "$current_tag" | head -n 1) - + last_tag=$(git tag --sort=-creatordate | grep -A1 "$current_tag" | tail -n 1) + if [ -z "$last_tag" ]; then echo "No previous tag found. Generating release notes for all history." - npx conventional-changelog -p angular -o release_notes.md + git log --pretty=format:"* %s" > release_notes.md else echo "Generating release notes from $last_tag to $current_tag." - npx conventional-changelog -p angular -o release_notes.md --from "$last_tag" --to "$current_tag" + git log --pretty=format:"* %s" "${last_tag}..HEAD" > release_notes.md fi - if [ ! -s release_notes.md ]; then - echo "Error: No new conventional commits found to generate release notes." - exit 1 - fi - + sed -i 's/ (#\([0-9]*\))/ (PR #\1)/' release_notes.md + echo "release_notes<> $GITHUB_ENV cat release_notes.md >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV