Skip to content

Commit f395197

Browse files
author
Taha ibn Munawar
committed
added fix for if nothing is available to be commited
1 parent e68bc19 commit f395197

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@ jobs:
3636
git config --global user.name 'Taha ibn Munawar'
3737
git config --global user.email '[email protected]'
3838
sshpass -v -P "Enter passphrase for key" -p $SSH_PASSWORD git clone [email protected]:mutawwir-blog/mutawwir-blog.github.io ./
39-
git branch -m main
4039
ls -A | awk '!/^\.git.*$/ { print $0 }' | while read line; do rm -rf ./$line; done
4140
4241
# Copying contents of parent into child, without copying the child itself too
4342
cp -r ~/work/mutawwir-blog/mutawwir-blog/dist/* ./
4443
touch .nojekyll
45-
git add .
46-
git commit -m "updated from github action workflow"
47-
sshpass -v -P "Enter passphrase for key" -p $SSH_PASSWORD git push
44+
if [[ -n $(git status -s) ]]; then
45+
git add .
46+
git commit -m "updated from github action workflow"
47+
sshpass -v -P "Enter passphrase for key" -p $SSH_PASSWORD git push
48+
fi
4849
4950

0 commit comments

Comments
 (0)