From 568129124ccd57d38ee10a051b7f4d7f551b9aaf Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Wed, 22 Feb 2023 13:51:48 +0100 Subject: [PATCH] chore: do not run functional tests on pull-requests forks These tests fail because they need the GITGUARDIAN_API_KEY variable, but it's not available for pull-requests coming from forks. Fixes #374 --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d2abffca1f..ff63c54649 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,6 +113,10 @@ jobs: fail_ci_if_error: false - name: Run functional tests + # For security reasons, secrets are not available when running tests for a pull request from a fork. This causes + # all functional tests to fail because GITGUARDIAN_API_KEY is not defined. To avoid this, skip this step if we + # were triggered by a pull request from a fork. + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository shell: bash run: | make functest GITGUARDIAN_API_KEY=${{ secrets.GITGUARDIAN_API_KEY }} GITGUARDIAN_API_URL=${{ secrets.GITGUARDIAN_API_URL }}