From ecff91d7f523eb527711c6a3b7163352786362ac Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Thu, 21 Nov 2024 23:41:33 +0545 Subject: [PATCH] Update ci.yml --- .github/workflows/ci.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fdae73..e895b83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,17 +27,19 @@ jobs: run: | python generate_readme.py - - name: Commit changes + - name: Commit changes if any run: | - # Configure git user info - git config --global user.name "github-actions" - git config --global user.email "github-actions@github.com" - - # Add and commit the changes to README.md + git config --local user.name "github-actions" + git config --local user.email "github-actions@github.com" git add README.md - git commit -m "Update README with new data" + if git diff-index --cached --quiet HEAD; then + echo "No changes to commit." + else + git commit -m "Update README with new data" + fi - name: Push changes to remote repository + if: success() # Ensures the step only runs if previous steps succeeded run: | git push https://github-actions[bot]:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}