Skip to content

Commit 24c3bd5

Browse files
authored
Skip all jobs on the Weekly beta compile test workflow when running on a fork (bevyengine#16674)
# Objective The weekly beta compile test workflow can be useful to people who have forked the repository. However, there are a few small issues with how this workflow is currently set up: * Scheduled workflows run on the base/default branch, with no way (currently) to change this. On forks, the base/default branch is usually kept in sync with the main Bevy repository, meaning that running this workflow on forks would just be a waste of resources. (See [here](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule) - "Scheduled workflows will only run on the default branch.") * Even if there was a way to change the branch that a scheduled workflow runs on, forks default to not having an issue tracker. * Even in the event that a fork's issue tracker is enabled, most users probably don't want to receive automated issues in the event of a compilation failure. Because of these reasons, this workflow is irrelevant for 99% of forks. ## Solution We now skip all jobs on the `Weekly beta compile test` workflow, if we detect we're running this workflow on a fork. ## Testing Testing? Who needs testing? (Seriously though, I made sure the syntax is correct.)
1 parent 72f096c commit 24c3bd5

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/weekly.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,29 @@ on:
1010
env:
1111
CARGO_TERM_COLOR: always
1212

13+
# The jobs listed here are intentionally skipped when running on forks, for a number of reasons:
14+
#
15+
# * Scheduled workflows run on the base/default branch, with no way (currently) to change this. On
16+
# forks, the base/default branch is usually kept in sync with the main Bevy repository, meaning
17+
# that running this workflow on forks would just be a waste of resources.
18+
#
19+
# * Even if there was a way to change the branch that a scheduled workflow runs on, forks default
20+
# to not having an issue tracker.
21+
#
22+
# * Even in the event that a fork's issue tracker is enabled, most users probably don't want to
23+
# receive automated issues in the event of a compilation failure.
24+
#
25+
# Because of these reasons, this workflow is irrelevant for 99% of forks. Thus, the jobs here will
26+
# be skipped when running on any repository that isn't the main Bevy repository.
27+
1328
jobs:
1429
test:
1530
strategy:
1631
matrix:
1732
os: [windows-latest, ubuntu-latest, macos-latest]
1833
runs-on: ${{ matrix.os }}
34+
# Disable this job when running on a fork.
35+
if: github.repository == 'bevyengine/bevy'
1936
timeout-minutes: 30
2037
steps:
2138
- uses: actions/checkout@v4
@@ -31,6 +48,8 @@ jobs:
3148

3249
lint:
3350
runs-on: ubuntu-latest
51+
# Disable this job when running on a fork.
52+
if: github.repository == 'bevyengine/bevy'
3453
timeout-minutes: 30
3554
steps:
3655
- uses: actions/checkout@v4
@@ -48,6 +67,8 @@ jobs:
4867

4968
check-compiles:
5069
runs-on: ubuntu-latest
70+
# Disable this job when running on a fork.
71+
if: github.repository == 'bevyengine/bevy'
5172
timeout-minutes: 30
5273
needs: test
5374
steps:
@@ -65,8 +86,9 @@ jobs:
6586
needs: [test, lint, check-compiles]
6687
permissions:
6788
issues: write
89+
# We disable this job on forks, because
6890
# Use always() so the job doesn't get canceled if any other jobs fail
69-
if: ${{ always() && contains(needs.*.result, 'failure') }}
91+
if: ${{ github.repository == 'bevyengine/bevy' && always() && contains(needs.*.result, 'failure') }}
7092
steps:
7193
- name: Create issue
7294
run: |

0 commit comments

Comments
 (0)