Skip to content

Commit a139e37

Browse files
Fixing fail status when no changes to commit
1 parent da3b965 commit a139e37

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,12 @@ jobs:
9494
working-directory: deploy-folder
9595
run: |
9696
git add .
97-
git commit -m "Deploy #${{ github.run_number }} from ${{ github.ref }} branch - ${{ steps.set-env.outputs.build_env }}"
98-
GIT_SSH_COMMAND="ssh -i ~/.ssh/deploy_key -o UserKnownHostsFile=~/.ssh/known_hosts" git push git@github.com:${{ github.repository }} gh-pages --force
97+
if git diff --cached --quiet; then
98+
echo "No changes to commit. Skipping deployment."
99+
else
100+
git commit -m "Deploy #${{ github.run_number }} from ${{ github.ref }} branch - ${{ steps.set-env.outputs.build_env }}"
101+
GIT_SSH_COMMAND="ssh -i ~/.ssh/deploy_key -o UserKnownHostsFile=~/.ssh/known_hosts" git push git@github.com:${{ github.repository }} gh-pages --force
102+
fi
99103
100104
- name: Clean Up Worktree
101105
run: git worktree remove deploy-folder --force

0 commit comments

Comments
 (0)