From de46fb6655c12e75a392a211cbac26e1cc04909c Mon Sep 17 00:00:00 2001 From: Ikechukwu Uchendu Date: Fri, 22 Sep 2023 16:31:07 +0000 Subject: [PATCH] fixed auto contributors script to handle no changes in contributors --- .github/workflows/auto-add-contributors.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/auto-add-contributors.yml b/.github/workflows/auto-add-contributors.yml index c1ce1d06..0a947748 100644 --- a/.github/workflows/auto-add-contributors.yml +++ b/.github/workflows/auto-add-contributors.yml @@ -39,16 +39,6 @@ jobs: python .github/workflows/contributors/update_contributors.py env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Committing changes to same branch - run: | - echo "Committing changes to same branch" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - git add .all-contributorsrc - git commit -m " Update contributors from github action" - git push - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Using all-contributors CLI to update files run: | echo "Using all-contributors CLI to update files" @@ -57,5 +47,5 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git add -u - git commit -m "Update readme and contributors.qmd with contributors" + git diff-index --quiet HEAD || git commit -m "Update readme and contributors.qmd with contributors" git push \ No newline at end of file