workflows: fix running pull_request_event (#413320)

authored by philiptaron.tngl.sh and committed by

GitHub d0593dc9 339da4f4

+7 -9
+5 -7
.github/workflows/codeowners-v2.yml
··· 45 45 check: 46 46 name: Check 47 47 runs-on: ubuntu-24.04-arm 48 - if: github.repository_owner == 'NixOS' 49 48 steps: 50 49 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 51 50 with: ··· 68 67 run: nix-build trusted/ci -A codeownersValidator 69 68 70 69 - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 71 - if: vars.OWNER_RO_APP_ID 70 + if: github.event_name == 'pull_request_target' && vars.OWNER_RO_APP_ID 72 71 id: app-token 73 72 with: 74 73 app-id: ${{ vars.OWNER_RO_APP_ID }} ··· 91 90 request: 92 91 name: Request 93 92 runs-on: ubuntu-24.04-arm 94 - if: github.repository_owner == 'NixOS' 95 93 steps: 96 94 - uses: cachix/install-nix-action@526118121621777ccd86f79b04685a9319637641 # v31 97 95 ··· 101 99 with: 102 100 path: trusted 103 101 102 + - name: Build review request package 103 + run: nix-build trusted/ci -A requestReviews 104 + 104 105 - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 105 - if: vars.OWNER_APP_ID 106 + if: github.event_name == 'pull_request_target' && vars.OWNER_APP_ID 106 107 id: app-token 107 108 with: 108 109 app-id: ${{ vars.OWNER_APP_ID }} ··· 110 111 permission-administration: read 111 112 permission-members: read 112 113 permission-pull-requests: write 113 - 114 - - name: Build review request package 115 - run: nix-build trusted/ci -A requestReviews 116 114 117 115 - name: Request reviews 118 116 if: steps.app-token.outputs.token
+1 -1
.github/workflows/eval.yml
··· 4 4 pull_request: 5 5 paths: 6 6 - .github/workflows/eval.yml 7 - - .github/workflows/reviews.yml # needs eval results from the same event type 7 + - .github/workflows/reviewers.yml # needs eval results from the same event type 8 8 pull_request_target: 9 9 push: 10 10 # Keep this synced with ci/request-reviews/dev-branches.txt
+1 -1
.github/workflows/reviewers.yml
··· 44 44 # See ./codeowners-v2.yml, reuse the same App because we need the same permissions 45 45 # Can't use the token received from permissions above, because it can't get enough permissions 46 46 - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 47 - if: vars.OWNER_APP_ID 47 + if: github.event_name == 'pull_request_target' && vars.OWNER_APP_ID 48 48 id: app-token 49 49 with: 50 50 app-id: ${{ vars.OWNER_APP_ID }}