diff --git a/.github/workflows/update_credits.yml b/.github/workflows/update_credits.yml index 8e17ebb6d7..601f5ea501 100644 --- a/.github/workflows/update_credits.yml +++ b/.github/workflows/update_credits.yml @@ -2,6 +2,8 @@ name: Update Credits upon opening PR on: pull_request: + branches: + - master types: - opened - synchronize @@ -10,7 +12,9 @@ jobs: update-credits: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} - run: | contributor_name=$(jq -r '.pull_request.user.login' $GITHUB_EVENT_PATH) pr_description=$(jq -r '.pull_request.body' $GITHUB_EVENT_PATH) @@ -26,7 +30,7 @@ jobs: git add .github/credits.md git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - git commit -m "Update credits.md with contributor information" || exit 0 + git commit -m "Update credits.md with contributor information" git push origin ${{ github.event.pull_request.head.ref }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}