Skip to content

Commit 60e3963

Browse files
authored
Disable workflows on forks (#5267)
1 parent 054f81a commit 60e3963

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

.github/workflows/cancel-duplicate-runs.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
cancel:
99
name: Cancel previous runs
1010
runs-on: ubuntu-latest
11+
if: github.repository == 'pydata/xarray'
1112
steps:
1213
- uses: styfle/[email protected]
1314
with:

.github/workflows/ci-additional.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ jobs:
1212
detect-ci-trigger:
1313
name: detect ci trigger
1414
runs-on: ubuntu-latest
15-
if: github.event_name == 'push' || github.event_name == 'pull_request'
15+
if: |
16+
github.repository == 'pydata/xarray'
17+
&& (github.event_name == 'push' || github.event_name == 'pull_request')
1618
outputs:
1719
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
1820
steps:
@@ -111,6 +113,7 @@ jobs:
111113
doctest:
112114
name: Doctests
113115
runs-on: "ubuntu-latest"
116+
if: github.repository == 'pydata/xarray'
114117
defaults:
115118
run:
116119
shell: bash -l {0}

.github/workflows/ci-pre-commit.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
linting:
1111
name: "pre-commit hooks"
1212
runs-on: ubuntu-latest
13+
if: github.repository == 'pydata/xarray'
1314
steps:
1415
- uses: actions/checkout@v2
1516
- uses: actions/setup-python@v2

.github/workflows/ci.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ jobs:
1212
detect-ci-trigger:
1313
name: detect ci trigger
1414
runs-on: ubuntu-latest
15-
if: github.event_name == 'push' || github.event_name == 'pull_request'
15+
if: |
16+
github.repository == 'pydata/xarray'
17+
&& (github.event_name == 'push' || github.event_name == 'pull_request')
1618
outputs:
1719
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
1820
steps:

.github/workflows/upstream-dev-ci.yaml

+4-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414
detect-ci-trigger:
1515
name: detect upstream-dev ci trigger
1616
runs-on: ubuntu-latest
17-
if: github.event_name == 'push' || github.event_name == 'pull_request'
17+
if: |
18+
github.repository == 'pydata/xarray'
19+
&& (github.event_name == 'push' || github.event_name == 'pull_request')
1820
outputs:
1921
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
2022
steps:
@@ -31,12 +33,8 @@ jobs:
3133
runs-on: ubuntu-latest
3234
needs: detect-ci-trigger
3335
if: |
34-
always()
35-
&& github.repository == 'pydata/xarray'
36-
&& (
3736
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
3837
|| needs.detect-ci-trigger.outputs.triggered == 'true'
39-
)
4038
defaults:
4139
run:
4240
shell: bash -l {0}
@@ -97,9 +95,7 @@ jobs:
9795
name: report
9896
needs: upstream-dev
9997
if: |
100-
always()
101-
&& github.event_name == 'schedule'
102-
&& github.repository == 'pydata/xarray'
98+
github.event_name == 'schedule'
10399
&& needs.upstream-dev.outputs.artifacts_availability == 'true'
104100
runs-on: ubuntu-latest
105101
defaults:

0 commit comments

Comments
 (0)