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 <katexochen0@gmail.com> (cherry picked from commit 4c63532c28094aeba6dccc5afb9690e02fd98d66)
This commit is contained in:
committed by
Luca Boccassi
parent
f9f3c11f40
commit
659d194912
@@ -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:
|
||||
|
||||
@@ -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' }}
|
||||
|
||||
Reference in New Issue
Block a user