From 659d194912c9bc58e0c8b7394fab525b47f1a94f Mon Sep 17 00:00:00 2001 From: Paul Meyer Date: Sun, 4 Oct 2026 12:03:16 +0200 Subject: [PATCH] ci: skip push-triggered jobs on forks Syncing a fork's main branch triggers the push workflows if actions are enabled, which then run the full CI matrix and use up the fork owner's Actions minutes for no benefit. Only skip push events so that PRs within a fork still run CI, which is useful for testing actions. Signed-off-by: Paul Meyer (cherry picked from commit 4c63532c28094aeba6dccc5afb9690e02fd98d66) --- .github/workflows/differential-shellcheck.yml | 4 +++- .github/workflows/mkosi.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml index 5937d67022..64999e60a4 100644 --- a/.github/workflows/differential-shellcheck.yml +++ b/.github/workflows/differential-shellcheck.yml @@ -15,7 +15,9 @@ permissions: jobs: lint: - if: github.event.repository.name != 'systemd-security' + if: > + github.event.repository.name != 'systemd-security' && + (github.event_name != 'push' || github.repository == 'systemd/systemd') runs-on: ubuntu-24.04 permissions: diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 27bb8c870d..37bdb698c5 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -46,6 +46,8 @@ permissions: jobs: ci: + # Don't run on pushes to forks, only on pushes to the upstream repositories + if: github.event_name != 'push' || github.repository == 'systemd/systemd' || github.repository == 'systemd/systemd-stable' runs-on: ${{ matrix.runner || 'ubuntu-24.04' }} concurrency: group: ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.release }}-${{ github.ref }}-${{ matrix.runner || 'ubuntu-24.04' }}