mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
[ci skip] Improve build workflow conditions (#11842)
The goal of the build workflow is split into multiple requirements. 1. Run on pushes to same repo. 2. Run on PR open/reopen/syncs from repos that are not the same (PRs from the same repo are covered by 1) 3. Run on labeled PRs that have the build-pr-jar flag.
This commit is contained in:
parent
ca8709b30f
commit
e10dcbf7ca
1 changed files with 11 additions and 2 deletions
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
|
@ -16,8 +16,17 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# Run on all label events (won't be duplicated) or all push events or on PR syncs not from the same repo
|
# The goal of the build workflow is split into multiple requirements.
|
||||||
if: (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'build-pr-jar') || github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name
|
# 1. Run on pushes to same repo.
|
||||||
|
# 2. Run on PR open/reopen/syncs from repos that are not the same (PRs from the same repo are covered by 1)
|
||||||
|
# 3. Run on labeled PRs that have the build-pr-jar flag.
|
||||||
|
if: >
|
||||||
|
(
|
||||||
|
(github.event_name == 'push')
|
||||||
|
|| (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name && contains(fromJSON('["opened", "reopened", "synchronize"]'), github.event.action))
|
||||||
|
|| (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'build-pr-jar')
|
||||||
|
)
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
|
Loading…
Reference in a new issue