Skip to content

Commit

Permalink
Removed the pull_request action trigger since that is only equipped w…
Browse files Browse the repository at this point in the history
…ith read-only access tokens
  • Loading branch information
uchendui committed Oct 3, 2023
1 parent e7ffbcf commit 3e2a1c1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/auto-add-contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3e2a1c1

Please sign in to comment.