From 13d62d5851ee6b5de15a50a1868d33cdd0e55027 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 26 Oct 2025 09:32:44 +0100 Subject: [PATCH] tests/sphinx-markdown-changelog: work around shallow clones in CI GitHub CI uses shallow clones where no Git tags available, which breaks tests/checks/sphinx-markdown-changelog.fish. Somehow tests/checks/sphinx-markdown-changelog.fish doesn't seem to have run CI before the next commit (or perhaps the python3 change from commit "tests/sphinx-markdown-changelog: workaround for mawk", 2025-10-26?). Anway, to prevent failure, disable that part of this test in CI for now; the point of the test is mostly to check the RST->Markdown conversion and syntax. --- build_tools/release-notes.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/build_tools/release-notes.sh b/build_tools/release-notes.sh index ab1d80ef7..03163f65c 100755 --- a/build_tools/release-notes.sh +++ b/build_tools/release-notes.sh @@ -12,17 +12,20 @@ mkdir -p "$relnotes_tmp/fake-workspace" "$relnotes_tmp/out" ) version=$(sed 's,^fish \(\S*\) .*,\1,; 1q' "$workspace_root/CHANGELOG.rst") add_stats=false -previous_version=$( - cd "$workspace_root" - git for-each-ref --format='%(objecttype) %(refname:strip=2)' refs/tags | - awk '/tag/ {print $2}' | sort --version-sort | - grep -vF "$(git describe)" | tail -1 -) -minor_version=${version%.*} -previous_minor_version=${previous_version%.*} -if [ "$minor_version" != "$previous_minor_version" ]; then - add_stats=true -fi +# Skip on shallow clone (CI) for now. +if test -z "$CI" || git -C "$workspace_root" tag | grep -q .; then { + previous_version=$( + cd "$workspace_root" + git for-each-ref --format='%(objecttype) %(refname:strip=2)' refs/tags | + awk '/tag/ {print $2}' | sort --version-sort | + grep -vF "$(git describe)" | tail -1 + ) + minor_version=${version%.*} + previous_minor_version=${previous_version%.*} + if [ "$minor_version" != "$previous_minor_version" ]; then + add_stats=true + fi +} fi { sed -n 1,2p <"$workspace_root/CHANGELOG.rst" if $add_stats; then {