File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments