From 467c3c699c4a165b87189347a1c872c718e0def0 Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Wed, 30 Nov 2022 11:18:13 +0530 Subject: [PATCH] Prevent Test-Suite-Fork from running on main (#1638) ## Description As of now, it looks like we are running `Test-Suite-Fork` in `main` instead of `Test-Suite-Trusted`. This tweaks the conditions so as to restrict the `Test-Suite-Fork` to just fork PRs. ## Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [x] :computer: CI/Deployment - [ ] :hamster: Trivial/Minor ## Test Plan - [ ] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- .github/workflows/ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d881b4aa..bce1b6714 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,10 +144,7 @@ jobs: needs: [Precheck, Checkout] environment: Testing runs-on: ubuntu-latest - if: (startsWith(github.ref, 'refs/tags/') || - github.ref == 'refs/heads/main' || - needs.precheck.outputs.srcfileschanged == 'true') && - github.event.pull_request.head.repo.full_name == github.repository + if: (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') || (needs.precheck.outputs.srcfileschanged == 'true' && github.event.pull_request.head.repo.full_name == github.repository) defaults: run: working-directory: src @@ -205,8 +202,7 @@ jobs: Test-Suite-Fork: needs: [Precheck] environment: Testing - if: (needs.precheck.outputs.srcfileschanged == 'true' && - github.event.pull_request.head.repo.full_name != github.repository) # only run when repo is forked + if: (!startsWith(github.ref , 'refs/tags/') && github.ref != 'refs/heads/main') && (needs.precheck.outputs.srcfileschanged == 'true' && github.event.pull_request.head.repo.full_name != github.repository) runs-on: ubuntu-latest defaults: run: