Skip to content

Commit aafd5e2

Browse files
fix: scope release-notify first-run to merge commit only
When no release-notify tag exists (first run), the fallback grabbed the last 30 commits instead of just the merged PR's changes, causing a huge changelog in the Slack notification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cee51d6 commit aafd5e2

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/release-notify.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,15 @@ jobs:
5555
run: |
5656
LAST_TAG=$(git tag -l 'release-notify/*' --sort=-creatordate | head -n1)
5757
if [ -z "$LAST_TAG" ]; then
58-
echo "No previous release-notify tag found, using last 30 commits"
59-
COMMIT_LOG=$(git log --oneline --no-merges -30)
60-
DIFF_STATS=$(git diff --stat HEAD~30 HEAD 2>/dev/null || echo "Unable to get diff stats")
58+
echo "No previous release-notify tag found, using merge commit only"
59+
MERGE_SHA="${{ github.event.pull_request.merge_commit_sha }}"
60+
if [ -n "$MERGE_SHA" ]; then
61+
COMMIT_LOG=$(git log --oneline --no-merges "${MERGE_SHA}^..${MERGE_SHA}")
62+
DIFF_STATS=$(git diff --stat "${MERGE_SHA}^" "${MERGE_SHA}" 2>/dev/null || echo "Unable to get diff stats")
63+
else
64+
COMMIT_LOG=$(git log --oneline --no-merges -1)
65+
DIFF_STATS=$(git diff --stat HEAD~1 HEAD 2>/dev/null || echo "Unable to get diff stats")
66+
fi
6167
else
6268
echo "Last release-notify tag: $LAST_TAG"
6369
COMMIT_LOG=$(git log --oneline --no-merges "${LAST_TAG}..HEAD")

0 commit comments

Comments
 (0)