Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions .github/actions/bump-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,28 @@ runs:
RANGE="HEAD"
fi

# Extract changelog lines from merge commit PR titles (strip conventional prefix for readability)
# `|| true` keeps an empty pipeline (e.g. grep finding no matches) from
# tripping `set -e -o pipefail` before the fallbacks below can run.
ENTRIES=$(git log "$RANGE" --merges --pretty=format:"%s" \
| sed -n 's/^Merge pull request #[0-9]* from .*//p; s/^.*: //p' \
| grep -v '^$' \
| grep -iv '^release\|^chore(release)' \
| head -20 \
| sed 's/^/- /')
| sed 's/^/- /' || true)

if [ -z "$ENTRIES" ]; then
# Fallback: use non-merge commit subjects
# Fallback: use non-merge commit subjects (covers squash merges)
ENTRIES=$(git log "$RANGE" --no-merges --pretty=format:"%s" \
| grep -v '^chore(release)' \
| head -20 \
| sed 's/^/- /')
| sed 's/^/- /' || true)
fi

if [ -z "$ENTRIES" ]; then
ENTRIES="- See release notes"
fi

# Write to file to preserve newlines across steps
echo "$ENTRIES" > /tmp/changelog_entries.txt
printf '%s\n' "$ENTRIES" > /tmp/changelog_entries.txt

- name: Bump version
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
with:
ref: ${{ needs.prep.outputs.release_branch }}
token: ${{ github.token }}
fetch-depth: 0
fetch-tags: true

- uses: ./.github/actions/bump-version
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
with:
ref: ${{ needs.prep.outputs.release_branch }}
token: ${{ github.token }}
fetch-depth: 0
fetch-tags: true

- uses: ./.github/actions/bump-version
with:
Expand Down
Loading