1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-09 09:36:20 +09:00

workflows: condition steps with secrets on pull_request_target event

In a pull_request event, vars are available, but secrets are not. Thus
the steps will run, even though there is no secret to request those
tokens - they will fail.

The intent was, to skip them entirely in that case.
This commit is contained in:
Wolfgang Walther 2025-06-02 20:33:47 +02:00
parent 48baebba50
commit 50f6d8d909
No known key found for this signature in database
GPG key ID: B39893FA5F65CAE1
2 changed files with 3 additions and 3 deletions

View file

@ -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 }}

View file

@ -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 }}