diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2025-05-26 09:46:28 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2025-05-26 09:50:37 -0400 |
commit | e6ffac396fcd66f83daa5202af4bd20a01c273d1 (patch) | |
tree | e7296593fb58b235eaf8668e49aa9802758f428f /.github/workflows | |
parent | 776b0293b45a65432eee5889abd0f18edc8e84da (diff) | |
download | bfs-e6ffac396fcd66f83daa5202af4bd20a01c273d1.tar.xz |
ci: Don't run duplicate jobs on PRs
Link: https://wildwolf.name/github-actions-how-to-avoid-running-the-same-workflow-multiple-times/
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/ci.yml | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6aefc90..4075eb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,9 +5,11 @@ on: [push, pull_request] jobs: linux-x86: name: Linux (x86) - runs-on: ubuntu-24.04 + # Don't run on both pushes and pull requests + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + steps: - uses: actions/checkout@v4 @@ -46,9 +48,10 @@ jobs: linux-arm: name: Linux (Arm64) - runs-on: ubuntu-24.04-arm + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + steps: - uses: actions/checkout@v4 @@ -76,9 +79,10 @@ jobs: macos: name: macOS - runs-on: macos-15 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + steps: - uses: actions/checkout@v4 @@ -93,9 +97,10 @@ jobs: freebsd: name: FreeBSD - runs-on: ubuntu-24.04 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + steps: - uses: actions/checkout@v4 @@ -120,9 +125,10 @@ jobs: openbsd: name: OpenBSD - runs-on: ubuntu-24.04 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + steps: - uses: actions/checkout@v4 @@ -148,9 +154,10 @@ jobs: netbsd: name: NetBSD - runs-on: ubuntu-24.04 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + steps: - uses: actions/checkout@v4 @@ -177,9 +184,10 @@ jobs: dragonflybsd: name: DragonFly BSD - runs-on: ubuntu-24.04 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + steps: - uses: actions/checkout@v4 @@ -211,9 +219,10 @@ jobs: omnios: name: OmniOS - runs-on: ubuntu-24.04 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + steps: - uses: actions/checkout@v4 |