@@ -12,20 +12,23 @@ jobs:
1212 - uses : actions/checkout@v2
1313 - name : Push tag for each updated package
1414 run : |
15- git config --global user.name "GitHub Action "
16- git config --global user.email "[email protected] " 15+ git config --global user.name "SDK Releaser Bot "
16+ git config --global user.email "[email protected] " 1717
1818 for file in $(git diff --name-only HEAD~1..HEAD | grep pyproject.toml); do
1919 if git diff HEAD~1..HEAD $file | grep "version ="; then
20- dirpath=$(dirname $file)
21- version=$(grep -o "version = .*" ${file} | cut -d '=' -f 2-)
22- dirpath=$(dirname $file)
23- relpath=${file#*/core|stackit/*}
24- cleaned_version=$(echo "$version" | tr -d '" ')
25- tag=$(echo "${dirpath}/${cleaned_version}")
26- git tag -a $tag -m "Release $version"
27- git push origin --tags
28- else
29- echo "No change in version found."
20+ version_changes=$(git diff HEAD~1..HEAD $file | grep "version =")
21+ splitted_version_changes=($(echo "$version_changes" | grep -oP '(?<=version = )[^ ]*'))
22+ # Check if all versions are equal
23+ if [ $(echo "${splitted_version_changes[@]}" | tr ' ' '\n' | sort -u | wc -l) -ne 1 ]; then
24+ dirpath=$(dirname $file)
25+ current_version=$(grep -o "version = .*" ${file} | cut -d '=' -f 2-)
26+ dirpath=$(dirname $file)
27+ relpath=${file#*/core|stackit/*}
28+ cleaned_version=$(echo "$current_version" | tr -d '" ')
29+ tag=$(echo "${dirpath}/${cleaned_version}")
30+ git tag -a $tag -m "Release $cleaned_version"
31+ git push origin tag $tag
32+ fi
3033 fi
3134 done
0 commit comments