diff --git a/.github/workflows/codeowners-v2.yml b/.github/workflows/codeowners-v2.yml index c4b2f65981ba..b7f875cce01b 100644 --- a/.github/workflows/codeowners-v2.yml +++ b/.github/workflows/codeowners-v2.yml @@ -67,7 +67,7 @@ jobs: run: nix-build trusted/ci -A codeownersValidator - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 - if: vars.OWNER_RO_APP_ID + if: github.event_name == 'pull_request_target' && vars.OWNER_RO_APP_ID id: app-token with: app-id: ${{ vars.OWNER_RO_APP_ID }} @@ -103,7 +103,7 @@ jobs: run: nix-build trusted/ci -A requestReviews - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 - if: vars.OWNER_APP_ID + if: github.event_name == 'pull_request_target' && vars.OWNER_APP_ID id: app-token with: app-id: ${{ vars.OWNER_APP_ID }} diff --git a/.github/workflows/reviewers.yml b/.github/workflows/reviewers.yml index 884cd2b266a6..a859ac70acb1 100644 --- a/.github/workflows/reviewers.yml +++ b/.github/workflows/reviewers.yml @@ -44,7 +44,7 @@ jobs: # See ./codeowners-v2.yml, reuse the same App because we need the same permissions # Can't use the token received from permissions above, because it can't get enough permissions - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 - if: vars.OWNER_APP_ID + if: github.event_name == 'pull_request_target' && vars.OWNER_APP_ID id: app-token with: app-id: ${{ vars.OWNER_APP_ID }}