From 3e2a1c145832beee5e716eaee76c7e005677280b Mon Sep 17 00:00:00 2001 From: Ikechukwu Uchendu Date: Tue, 3 Oct 2023 14:20:34 +0000 Subject: [PATCH] Removed the pull_request action trigger since that is only equipped with read-only access tokens --- .github/workflows/auto-add-contributors.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto-add-contributors.yml b/.github/workflows/auto-add-contributors.yml index 3674366e..765e2afb 100644 --- a/.github/workflows/auto-add-contributors.yml +++ b/.github/workflows/auto-add-contributors.yml @@ -3,15 +3,8 @@ on: push: branches: - main - pull_request: - branches: - - main - types: - - closed - jobs: update-contributors: - if: (github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) runs-on: ubuntu-latest steps: - name: Checkout repository @@ -49,10 +42,16 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" + # Stash any changes made to the README.md and contributors.qmd files + git stash + # Fetch the latest state of the master branch and try to merge git fetch origin main git merge origin/main + # Pop the stashed changes + git stash pop + git add -u git diff-index --quiet HEAD || git commit -m "Update readme and contributors.qmd with contributors" git push