From 6de8113720408127bc9fc98339448069ee956e35 Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Sat, 13 Aug 2022 09:33:37 +0100 Subject: [PATCH] test: prevent running both `push` and `pull_request` actions at the same time (#3597) Not a 100% perfect solution, however as us maintainers always push branches directly to the original repository and make PRs from those, this is plenty enough. Instead of having 300+ actions in each PR which takes time, we'll just have the normal 171 `push` actions. This makes sure to still run `pull_request` actions from contributors as they'd be forking the repo. Signed-off-by: Sami Mazouz --- .github/workflows/REUSABLE_backend.yml | 4 +++- .github/workflows/REUSABLE_frontend.yml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/REUSABLE_backend.yml b/.github/workflows/REUSABLE_backend.yml index a4b8c75bc..84dff2467 100644 --- a/.github/workflows/REUSABLE_backend.yml +++ b/.github/workflows/REUSABLE_backend.yml @@ -88,7 +88,9 @@ jobs: name: 'PHP ${{ matrix.php }} / ${{ matrix.db }} ${{ matrix.prefixStr }}' - if: inputs.enable_backend_testing + if: >- + inputs.enable_backend_testing && + ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || github.event_name != 'pull_request') steps: - uses: actions/checkout@master diff --git a/.github/workflows/REUSABLE_frontend.yml b/.github/workflows/REUSABLE_frontend.yml index 81491d138..f68487096 100644 --- a/.github/workflows/REUSABLE_frontend.yml +++ b/.github/workflows/REUSABLE_frontend.yml @@ -91,6 +91,9 @@ jobs: name: Checks & Build runs-on: ubuntu-latest + if: >- + ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || github.event_name != 'pull_request') + steps: - name: Check out code uses: actions/checkout@v2