@@ -17,31 +17,31 @@ jobs:
17
17
echo "No pyproject.toml files changed"
18
18
exit 0
19
19
fi
20
- echo "$pyproject_toml_files"
20
+ echo "pyproject_toml_files= $pyproject_toml_files" >> $GITHUB_ENV
21
21
- name : Check version update
22
22
run : |
23
23
git config --global user.name "GitHub Action"
24
24
git config --global user.email "github-action@github.com"
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
29
44
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
47
47
done
0 commit comments