diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 09d43f5..a3b22d0 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -44,12 +44,19 @@ jobs: git config --global user.name "github-actions" git config --global user.email "github-actions@github.com" - # Check if there are any changes to commit + # Stage changes git add . - git commit -m "Update directory listings" - # Push only if there are changes - git push + # Check if there are any changes to commit + if git diff --cached --quiet; then + echo "No changes to commit." + else + # Commit changes if there are any + git commit -m "Update directory listings" + + # Push changes to the remote repository + git push + fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload artifact