From 8bd73175e0e0fab971fc6fdc5d63e37c485a38b6 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Wed, 22 Mar 2023 10:47:22 +0100 Subject: [PATCH] chore: run CI on up to date PRs (#9885) --- .github/workflows/changed-packages.yml | 9 +++++++++ .github/workflows/ci.yml | 2 ++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/changed-packages.yml b/.github/workflows/changed-packages.yml index 7e91262c..be6ca130 100644 --- a/.github/workflows/changed-packages.yml +++ b/.github/workflows/changed-packages.yml @@ -4,6 +4,10 @@ permissions: read-all on: workflow_call: + inputs: + check-mergeable-state: + default: false + type: boolean outputs: changes: description: 'The packages that were changed for this PR' @@ -19,6 +23,11 @@ jobs: uses: actions/checkout@v3.3.0 with: fetch-depth: 2 + - name: Check if branch is out of date + if: ${{ inputs.check-mergeable-state }} + run: | + git fetch origin main --depth 1 && + git merge-base --is-ancestor origin/main @; - name: Detect changed packages uses: dorny/paths-filter@v2.11.1 id: changes diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af0469c8..b73f563d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,8 @@ jobs: check-changes: needs: inspect-code uses: ./.github/workflows/changed-packages.yml + with: + check-mergeable-state: true deploy-docs: needs: check-changes