From 9c6d1af102bd5986b254fc8def72cc3c80c74785 Mon Sep 17 00:00:00 2001 From: honorless <86894501+lesshonor@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:43:54 -0400 Subject: [PATCH] ci(build): limit run scope * Cancel redundant non-nightly runs and jobs dependent on canceled jobs. * Limit scheduled runs to zmkfirmware-owned repos. --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b54c9eef..9e09dc21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,10 @@ on: schedule: - cron: "22 4 * * *" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'schedule' }} + cancel-in-progress: true + permissions: {} jobs: @@ -135,7 +139,7 @@ jobs: throw new Error('Failed to build one or more configurations'); } compile-matrix: - if: ${{ always() }} + if: ${{ !cancelled() }} runs-on: ubuntu-latest needs: [core-coverage, board-changes, nightly] outputs: @@ -290,7 +294,7 @@ jobs: }); }))).flat(); nightly: - if: ${{ github.event_name == 'schedule' }} + if: ${{ github.event_name == 'schedule' && github.repository_owner == 'zmkfirmware' }} runs-on: ubuntu-latest needs: get-grouped-hardware outputs: