Skip to content

Commit b30975f

Browse files
committed
fix(ci): avoid running drivers CI jobs that need secrets in PR coming from forks.
Signed-off-by: Federico Di Pierro <[email protected]>
1 parent 5b9db23 commit b30975f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/drivers_ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
runs-on: ubuntu-22.04
182182
# Avoid running on forks since this job uses a private secret
183183
# not available on forks, leading to failures.
184-
if: github.repository == 'falcosecurity/libs'
184+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'falcosecurity/libs'
185185
needs: paths-filter
186186
steps:
187187
- name: Extract branch name
@@ -351,7 +351,7 @@ jobs:
351351
needs: paths-filter
352352
# Avoid running on forks since this job uses a private secret
353353
# not available on forks, leading to failures.
354-
if: github.repository == 'falcosecurity/libs' && github.event_name == 'pull_request' && (needs.paths-filter.outputs.driver == 'true' || needs.paths-filter.outputs.libscap == 'true' || needs.paths-filter.outputs.libpman == 'true')
354+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'falcosecurity/libs' && (needs.paths-filter.outputs.driver == 'true' || needs.paths-filter.outputs.libscap == 'true' || needs.paths-filter.outputs.libpman == 'true')
355355
uses: ./.github/workflows/reusable_kernel_tests.yaml
356356
with:
357357
# Use real branch's HEAD sha, not the merge commit
@@ -362,7 +362,7 @@ jobs:
362362
needs: kernel-tests-dev
363363
# Avoid running on forks since this job uses a private secret
364364
# not available on forks, leading to failures.
365-
if: github.repository == 'falcosecurity/libs' && github.event_name == 'pull_request' && (needs.paths-filter.outputs.driver == 'true' || needs.paths-filter.outputs.libscap == 'true' || needs.paths-filter.outputs.libpman == 'true')
365+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'falcosecurity/libs' && (needs.paths-filter.outputs.driver == 'true' || needs.paths-filter.outputs.libscap == 'true' || needs.paths-filter.outputs.libpman == 'true')
366366
runs-on: ubuntu-latest
367367
steps:
368368
- name: Download X64 matrix

0 commit comments

Comments
 (0)