From 4682cf91a4a32b5e99d7a750fc9c69e3e7d2b513 Mon Sep 17 00:00:00 2001 From: Philip Bruvoll Date: Fri, 23 Oct 2026 12:58:54 +0200 Subject: [PATCH] ci: skip Cypress on draft pull requests Mirrors altinn-studio#18333. Also groups the fork conditions in the internal job so the repository owner check applies to both branches of the OR. --- .github/workflows/cypress.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 72a25b44b5..c33b6fb135 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -24,6 +24,7 @@ on: jobs: install: + if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }} name: Install runs-on: ubuntu-latest container: @@ -52,9 +53,12 @@ jobs: cypress-run-internal: name: Cypress Run Internal if: | + (github.event_name != 'pull_request' || !github.event.pull_request.draft) && github.repository_owner == 'Altinn' && - (github.event_name != 'pull_request' && github.event.repository.fork == false) || - (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) + ( + (github.event_name != 'pull_request' && github.event.repository.fork == false) || + (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) + ) runs-on: ubuntu-latest container: image: cypress/browsers:node-22.13.1-chrome-133.0.6943.53-1-ff-135.0-edge-132.0.2957.140-1@sha256:914c9814a9567f32660203db7ecd610b8f8fede6e9103885728b3bd3f6dca4ff @@ -116,6 +120,7 @@ jobs: cypress-run-external: name: Cypress Run External if: | + (github.event_name != 'pull_request' || !github.event.pull_request.draft) && github.repository_owner == 'Altinn' && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true)