File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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")
You can’t perform that action at this time.
0 commit comments