Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove conventional changelog checks for publish, take all commits since last tag #17

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions .github/workflows/ci-publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<<EOF" >> $GITHUB_ENV
cat release_notes.md >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
Expand Down
Loading