Skip to content

Commit fb7c546

Browse files
authored
disable jobs which require secrets when PR is a dependabot update (#1238)
1 parent 64781fa commit fb7c546

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
proxy-sanity-check:
2727
name: Proxy Sanity Check
2828
runs-on: ubuntu-22.04
29-
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref_name, 'dependabot-') }}
29+
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.head_ref, 'dependabot-') }}
3030
env:
3131
GOPROXY: "https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev"
3232
steps:
@@ -145,7 +145,7 @@ jobs:
145145
official-oss-image-integration-tests:
146146
name: Integration Tests - Official OSS Images
147147
needs: build-unsigned-snapshot
148-
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref_name, 'dependabot-') }}
148+
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.head_ref, 'dependabot-') }}
149149
runs-on: ubuntu-22.04
150150
strategy:
151151
matrix:
@@ -184,7 +184,7 @@ jobs:
184184
official-plus-image-integration-tests:
185185
name: Integration Tests - Official Plus Images
186186
needs: build-unsigned-snapshot
187-
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref_name, 'dependabot-') }}
187+
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.head_ref, 'dependabot-') }}
188188
runs-on: ubuntu-22.04
189189
strategy:
190190
matrix:
@@ -265,7 +265,7 @@ jobs:
265265
run: git push 'https://github-actions:${{ secrets.GITHUB_TOKEN }}@github.com/nginx/agent.git' benchmark-results:benchmark-results
266266
load-tests:
267267
name: Load Tests
268-
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref_name, 'dependabot-') }}
268+
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.head_ref, 'dependabot-') }}
269269
permissions:
270270
contents: write
271271
runs-on: ubuntu-22.04

.github/workflows/mend.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ permissions:
2525

2626
jobs:
2727
mend:
28-
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event_name == 'push' && github.event.repository.fork == false) }}
28+
if: >-
29+
${{
30+
(github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && !startsWith(github.head_ref, 'dependabot-')) ||
31+
(github.event_name == 'push' && !github.event.repository.fork)
32+
}}
2933
uses: nginxinc/compliance-rules/.github/workflows/mend.yml@a27656f8f9a8748085b434ebe007f5b572709aad # v0.2
3034
secrets: inherit
3135
with:

0 commit comments

Comments
 (0)