CI: release notes link direct upstream commits to their real GitHub id

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-30 19:09:43 +01:00
1 parent 0cc30308e9
commit c32ba219dd
1 file changed
+14 -1
+14 -1
View File
@@ -372,6 +372,14 @@ jobs:
# upstream: the first-parent line of each merged upstream branch, # upstream: the first-parent line of each merged upstream branch,
# PR merges as their title, direct commits as their subject # PR merges as their title, direct commits as their subject
declare -A seen=() declare -A seen=()
# A direct upstream commit (no PR) links to GitHub by its ORIGINAL
# id: the public export (filter-repo) gives every upstream commit a
# new one, which GitHub does not know (30. 11. 2026: "* sec patch"
# linked to a 404). Author email + author time survive the rewrite.
declare -A upid=()
if git fetch -q --no-tags "$gh.git" '+refs/heads/main:refs/upstream/main' '+refs/heads/dev:refs/upstream/dev'; then
while read -r h k; do upid[$k]=$h; done < <(git log --format='%H %ae/%at' refs/upstream/main refs/upstream/dev)
fi
ups=() ups=()
for m in $(git log --first-parent --merges --grep='^Merge upstream' --format=%H "$base..$SHA"); do for m in $(git log --first-parent --merges --grep='^Merge upstream' --format=%H "$base..$SHA"); do
for c in $(git log --first-parent --format=%H "$m^1..$m^2"); do for c in $(git log --first-parent --format=%H "$m^1..$m^2"); do
@@ -385,7 +393,12 @@ jobs:
elif [[ $s != Merge* ]]; then elif [[ $s != Merge* ]]; then
[ -z "${seen[$c]:-}" ] || continue [ -z "${seen[$c]:-}" ] || continue
seen[$c]=1 seen[$c]=1
ups+=("- $s ([${c:0:7}]($gh/commit/$c))") u=${upid[$(git log -1 --format='%ae/%at' "$c")]:-}
if [ -n "$u" ]; then
ups+=("- $s ([${u:0:7}]($gh/commit/$u))")
else
ups+=("- $s ([${c:0:7}]($web/commit/$c))")
fi
fi fi
done done
done done