diff --git a/.github/workflows/pub-release.yml b/.github/workflows/pub-release.yml index 43c570c3..81898439 100644 --- a/.github/workflows/pub-release.yml +++ b/.github/workflows/pub-release.yml @@ -203,9 +203,20 @@ jobs: | sort_by(.created_at) | reverse | .[] | "\(.tag_name) \(.target_commitish)"') # no older release: the last 20 commits of our own line [ -n "$base" ] || base=$(git rev-list --first-parent --max-count=21 "$SHA" | tail -1) - # ours: commits on our main itself (first parent), not what the - # upstream merges brought in - ours=$(git log --first-parent --no-merges --format="- %s ([%h]($web/commit/%H))" "$base..$SHA") + # ours: commits on our main itself (first parent); a merge of one of + # our own branches (feat/...) is unfolded into the branch's commits, + # an upstream merge is left to the upstream list below + fmt="- %s ([%h]($web/commit/%H))" + ours="" + for c in $(git log --first-parent --format=%H "$base..$SHA"); do + if git rev-parse -q --verify "$c^2" >/dev/null; then + git log -1 --format=%s "$c" | grep -q '^Merge upstream' && continue + ours+=$(git log --no-merges --format="$fmt" "$c^1..$c^2")$'\n' + else + ours+=$(git log -1 --format="$fmt" "$c")$'\n' + fi + done + ours=${ours%$'\n'} # upstream: the first-parent line of each merged upstream branch, # PR merges as their title, direct commits as their subject declare -A seen=()