Skip to content

Commit

Permalink
Update static.yml with if/else
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinnguyenn authored Dec 11, 2024
1 parent 74d5bca commit de6eb23
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,19 @@ jobs:
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
# 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
Expand Down

0 comments on commit de6eb23

Please sign in to comment.