Skip to content

Commit 72866de

Browse files
committed
adds workflow for creating tag
1 parent 3bb79d1 commit 72866de

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

.github/workflows/release-trigger.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -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 "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
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

Comments
 (0)