From 16ac62f62b681528dd8e8d8027bda300f3147066 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Thu, 12 Sep 2024 16:14:11 +0200 Subject: [PATCH] fix(ci): avoid running drivers CI jobs that need secrets in PR coming from forks. Signed-off-by: Federico Di Pierro --- .github/workflows/drivers_ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/drivers_ci.yml b/.github/workflows/drivers_ci.yml index 09adf83f61..953d8312b1 100644 --- a/.github/workflows/drivers_ci.yml +++ b/.github/workflows/drivers_ci.yml @@ -181,7 +181,7 @@ jobs: runs-on: ubuntu-22.04 # Avoid running on forks since this job uses a private secret # not available on forks, leading to failures. - if: github.repository == 'falcosecurity/libs' + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'falcosecurity/libs' needs: paths-filter steps: - name: Extract branch name @@ -351,7 +351,7 @@ jobs: needs: paths-filter # Avoid running on forks since this job uses a private secret # not available on forks, leading to failures. - 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') + 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') uses: ./.github/workflows/reusable_kernel_tests.yaml with: # Use real branch's HEAD sha, not the merge commit @@ -362,7 +362,7 @@ jobs: needs: kernel-tests-dev # Avoid running on forks since this job uses a private secret # not available on forks, leading to failures. - 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') + 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') runs-on: ubuntu-latest steps: - name: Download X64 matrix