Skip to content

Commit

Permalink
trying to fix git commit when no changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rino authored and Rino committed Aug 14, 2024
1 parent 97b2d2d commit 0f53ec2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,5 @@ jobs:
run: |
git config user.email "[email protected]"
git config user.name "Github Actions"
- name: git commit to dev
run: |
git add .
git commit -a -m "Updates by gallery script"
git push
- name: git commit and push
run: ./_tools/commit.sh
19 changes: 19 additions & 0 deletions _tools/commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Navigate to the Git repository directory
cd ..

# Check if there are any changes
if git diff-index --quiet HEAD --; then
# No changes
echo "No changes to commit."
else
# Changes detected, add all changes to staging
git add .

# Commit changes
git commit -m "Updates by gallery script"

# Optionally, push changes to remote repository
git push
fi

0 comments on commit 0f53ec2

Please sign in to comment.