From 06033af23c81ecc48974c5a3e56ec9dde9a8b0bf Mon Sep 17 00:00:00 2001 From: Erez Rokah Date: Thu, 17 Feb 2022 16:03:24 +0100 Subject: [PATCH] chore(ci): don't run update contributors on forked PRs (#4323) * chore(ci): don't run update contributors on forked PRs * chore: update contributors field Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .github/workflows/contributors.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml index 0a7e68365bf..e2c8bd8b587 100644 --- a/.github/workflows/contributors.yml +++ b/.github/workflows/contributors.yml @@ -6,14 +6,21 @@ on: jobs: update-contributors: runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false }} steps: + - uses: navikt/github-app-token-generator@2d70c12368d1958155af4d283f9f21c9a2a8cb98 + id: get-token + with: + private-key: ${{ secrets.TOKENS_PRIVATE_KEY }} + app-id: ${{ secrets.TOKENS_APP_ID }} - name: Git checkout uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} - - uses: netlify/update-contributors-action@main + token: ${{ steps.get-token.outputs.token }} + - uses: netlify/update-contributors-action@v1 with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ steps.get-token.outputs.token }} - uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: 'chore: update contributors field'