Skip to content

Commit 952e140

Browse files
authored
CI: Remove duplicated items from changelog (#346)
If the previous release's last commit was not a tagged commit (e.g. runtime file update), the last commit was also listed in the bottom of the new changelog. Check the changelog of the previous release and extract the latest commit id to avoid the duplication.
1 parent e4b0c11 commit 952e140

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

scripts/update-repo.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@ if [ ! -d vim/src ]; then
2323
git submodule init
2424
fi
2525
git submodule update
26-
# get the last released tag name from this repo
27-
vimoldver=$(curl -s https://api.github.com/repos/vim/vim-win32-installer/releases/latest | python -c 'import sys; from json import loads as l; print(l(sys.stdin.read())["tag_name"])')
26+
27+
# get the last released commit id from this repo
28+
curl -s https://api.github.com/repos/vim/vim-win32-installer/releases/latest -o latest.json
29+
vimoldver=$(cat latest.json | python -c 'import sys; from json import loads as l; print(l(sys.stdin.read())["body"])' | sed -n -e '/.*(https:\/\/github\.com\/vim\/vim\/commit\/\([0-9a-f]*\)).*/{s//\1/;p;q}')
30+
if [ -z "$vimoldver" ]; then
31+
# Fall back to the latest tag name
32+
vimoldver=$(cat latest.json | python -c 'import sys; from json import loads as l; print(l(sys.stdin.read())["tag_name"])')
33+
fi
34+
rm latest.json
2835

2936
# Get the latest vim source code
3037
cd vim

0 commit comments

Comments
 (0)