Skip to content

Commit 954e4fb

Browse files
author
Aymen
committed
handle push in flow
1 parent 8da710c commit 954e4fb

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,19 @@ jobs:
6363
git config --global user.email "[email protected]"
6464
git add build.gradle.kts
6565
git add increment_version.sh
66-
git commit -m "Bump version to $NEW_VERSION"
66+
git commit -m "Bump version to $NEW_VERSION" || echo "No changes to commit"
6767
git tag $NEW_VERSION
68-
git push -f https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/aymenbs2/AymoAi.git --tags
69-
git push -f https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/aymenbs2/AymoAi.git HEAD:main
68+
69+
- name: Push changes if any
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
run: |
73+
if [ -z "$(git status --porcelain)" ]; then
74+
echo "No changes to push"
75+
else
76+
git push -f https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/aymenbs2/AymoAi.git --tags
77+
git push -f https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/aymenbs2/AymoAi.git HEAD:main
78+
fi
7079
7180
- name: Build with Gradle
7281
run: ./gradlew build

0 commit comments

Comments
 (0)