@@ -10,38 +10,22 @@ jobs:
10
10
runs-on : ubuntu-latest
11
11
steps :
12
12
- uses : actions/checkout@v2
13
- - name : Find pyproject.toml files
14
- run : |
15
- pyproject_toml_files=$(git diff --name-only HEAD~1..HEAD | grep pyproject.toml)
16
- if [ -z "$pyproject_toml_files" ]; then
17
- echo "No pyproject.toml files changed"
18
- exit 0
19
- fi
20
- echo "pyproject_toml_files=$pyproject_toml_files" >> $GITHUB_ENV
21
- - name : Check version update
13
+ - name : Push tag for each updated package
22
14
run : |
23
15
git config --global user.name "GitHub Action"
24
16
git config --global user.email "github-action@github.com"
25
17
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
44
- else
45
- echo "No change in version found."
46
- fi
18
+ for file in $(git diff --name-only HEAD~1..HEAD | grep pyproject.toml); do
19
+ 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."
30
+ fi
47
31
done
0 commit comments