From fc52448ba2ce2d9f993c89ddc10ce426b768ab63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Petrovick=C3=BD?= Date: Tue, 9 Apr 2024 07:47:13 +0200 Subject: [PATCH] ci: only prevent stale forks when actually running from a fork --- .github/workflows/pull_request.yml | 1 + .github/workflows/pull_request_gradle.yml | 1 + .github/workflows/pull_request_native.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d1a90837bc..bf13854368 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -50,6 +50,7 @@ jobs: path: ./timefold-solver fetch-depth: 0 # Otherwise merge will fail on account of not having history. - name: Prevent stale fork of timefold-solver + if: steps.checkout-solver.outcome == 'success' env: BLESSED_REPO: "timefold-solver" BLESSED_BRANCH: ${{ endsWith(github.head_ref, '.x') && github.head_ref || 'main' }} diff --git a/.github/workflows/pull_request_gradle.yml b/.github/workflows/pull_request_gradle.yml index b00f86d7e2..4120ea7fca 100644 --- a/.github/workflows/pull_request_gradle.yml +++ b/.github/workflows/pull_request_gradle.yml @@ -35,6 +35,7 @@ jobs: path: ./timefold-solver fetch-depth: 0 # Otherwise merge will fail on account of not having history. - name: Prevent stale fork of timefold-solver + if: steps.checkout-solver.outcome == 'success' env: BLESSED_REPO: "timefold-solver" BLESSED_BRANCH: ${{ endsWith(github.head_ref, '.x') && github.head_ref || 'main' }} diff --git a/.github/workflows/pull_request_native.yml b/.github/workflows/pull_request_native.yml index f0d86a100b..a17e5d4e86 100644 --- a/.github/workflows/pull_request_native.yml +++ b/.github/workflows/pull_request_native.yml @@ -41,6 +41,7 @@ jobs: path: ./timefold-solver fetch-depth: 0 # Otherwise merge will fail on account of not having history. - name: Prevent stale fork of timefold-solver + if: steps.checkout-solver.outcome == 'success' env: BLESSED_REPO: "timefold-solver" BLESSED_BRANCH: ${{ endsWith(github.head_ref, '.x') && github.head_ref || 'main' }}