Skip to content

Commit

Permalink
build: only push README changes if anything actually changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Feb 3, 2024
1 parent ff9cf33 commit bf78f94
Showing 1 changed file with 51 additions and 5 deletions.
56 changes: 51 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,54 @@ jobs:
- name: Commit and push changes
run: |
git config --global user.name 'jjjermiah'
git config --global user.email 'jjjermiah@users.noreply.github.com'
git add README.md
git commit -m "Update README with latest version"
git push
# Check for changes
if [[ $(git status --porcelain) ]]; then
# Changes are present
echo "Changes found. Committing and pushing..."
# Add all changes
git add .
# Commit with a timestamp
git commit -m "Auto commit: $(date)"
# Push changes to the remote repository
git push origin main
echo "Changes committed and pushed successfully."
else
# No changes
echo "No changes found. Nothing to commit or push."
fi
# git config --global user.name 'jjjermiah'
# git config --global user.email 'jjjermiah@users.noreply.github.com'
# git add README.md
# git commit -m "Update README with latest version"
# git push
# #!/bin/bash

# # Check for changes
# if [[ $(git status --porcelain) ]]; then
# # Changes are present
# echo "Changes found. Committing and pushing..."

# # Add all changes
# git add .

# # Commit with a timestamp
# git commit -m "Auto commit: $(date)"

# # Push changes to the remote repository
# git push origin <your-branch-name>

# echo "Changes committed and pushed successfully."
# else
# # No changes
# echo "No changes found. Nothing to commit or push."
# fi

0 comments on commit bf78f94

Please sign in to comment.