Skip to content

Commit 2258d6f

Browse files
committed
[Breaking Change + Bug Fix] (config) Modify the implementation logic about 'git diff' by git tag, doesn't by git branch.
1 parent 1ac1b52 commit 2258d6f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/ci/build_git-tag_or_create_github-release.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,16 @@ elif [ "$Input_Arg_Release_Type" == 'github-action-reusable-workflow' ]; then
294294
git remote -v
295295

296296
echo "🔬 📄 🌳 ⛓ 🌳 Check the different of '.github/release-notes.md' between current git branch and master branch ..."
297-
release_notes_has_diff=$(git diff origin/master "$Current_Branch" -- .github/release-notes.md | cat)
297+
# # v1: compare by git branches
298+
# release_notes_has_diff=$(git diff origin/master "$Current_Branch" -- .github/release-notes.md | cat)
299+
# # v2: compare by git tag
300+
all_git_tags=$(git tag -l | cat)
301+
declare -a all_git_tags_array=( $(echo "$all_git_tags" | awk -v RS='' '{gsub("\n"," "); print}') )
302+
all_git_tags_array_len=${#all_git_tags_array[@]}
303+
latest_git_tag=${all_git_tags_array[$all_git_tags_array_len - 1]}
304+
echo "🔎 🌳 🏷 The latest git tag: $latest_git_tag"
305+
306+
release_notes_has_diff=$(git diff "$latest_git_tag" "$Current_Branch" -- .github/release-notes.md | cat)
298307
echo "🔎 🔬 📄 different of '.github/release-notes.md': $release_notes_has_diff"
299308

300309
if [ "$release_notes_has_diff" != "" ]; then

0 commit comments

Comments
 (0)