@@ -17,31 +17,31 @@ jobs:
1717 echo "No pyproject.toml files changed"
1818 exit 0
1919 fi
20- echo "$pyproject_toml_files"
20+ echo "pyproject_toml_files= $pyproject_toml_files" >> $GITHUB_ENV
2121 - name : Check version update
2222 run : |
2323 git config --global user.name "GitHub Action"
2424 git config --global user.email "[email protected] " 25- for file in ${{ steps.find-pyproject-toml-files.outputs.pyproject_toml_files }}; do
26- git diff --quiet HEAD~1..HEAD $file || true
27- if git diff --quiet HEAD~1..HEAD $file; then
28- echo "No changes in $file"
25+
26+ for file in ${pyproject_toml_files}; do
27+ if git diff HEAD~1..HEAD $file | grep "version ="; then
28+ dirpath=$(dirname $file)
29+ echo "pyproject.toml updated in $dirpath"
30+ # Run your action here
31+ version=$(grep -o "version = .*" ${file} | cut -d '=' -f 2-)
32+ dirpath=$(dirname $file)
33+ relpath=${file#*/core|stackit/*}
34+ cleaned_version=$(echo "$version" | tr -d '" ')
35+ tag=$(echo "${dirpath}/${cleaned_version}")
36+ echo $file
37+ echo $dirpath
38+ echo $cleaned_version
39+ echo $tag
40+
41+ #git tag -a $tag -m "Release $version"
42+ echo $(git status)
43+ # git push origin --tags
2944 else
30- version_line=$(git diff HEAD~1..HEAD $file | grep "^+.*version = ")
31- if [ -n "$version_line" ]; then
32- echo "Version updated in $file"
33- # Run your action here
34- version=$(grep -o "version = .*" file.txt | cut -d '=' -f 2-)
35- # Get the update package
36- dirpath=$(dirname "$filepath")
37- relpath=${filepath#*/core|stackit/*}
38- tag = ${relpath}/${version}
39- echo $tag
40- git tag -a $version -m "Release $version"
41- echo git status
42- # git push origin --tags
43- else
44- echo "No version update in $file"
45- fi
46- fi
45+ echo "No change in version found."
46+ fi
4747 done
0 commit comments