Skip to content

Commit

Permalink
Disable workflows on forks (#5267)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersy005 authored May 6, 2021
1 parent 054f81a commit 60e3963
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cancel-duplicate-runs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
cancel:
name: Cancel previous runs
runs-on: ubuntu-latest
if: github.repository == 'pydata/xarray'
steps:
- uses: styfle/cancel-workflow-action@0.9.0
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:
detect-ci-trigger:
name: detect ci trigger
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
if: |
github.repository == 'pydata/xarray'
&& (github.event_name == 'push' || github.event_name == 'pull_request')
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
Expand Down Expand Up @@ -111,6 +113,7 @@ jobs:
doctest:
name: Doctests
runs-on: "ubuntu-latest"
if: github.repository == 'pydata/xarray'
defaults:
run:
shell: bash -l {0}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
linting:
name: "pre-commit hooks"
runs-on: ubuntu-latest
if: github.repository == 'pydata/xarray'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:
detect-ci-trigger:
name: detect ci trigger
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
if: |
github.repository == 'pydata/xarray'
&& (github.event_name == 'push' || github.event_name == 'pull_request')
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
detect-ci-trigger:
name: detect upstream-dev ci trigger
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
if: |
github.repository == 'pydata/xarray'
&& (github.event_name == 'push' || github.event_name == 'pull_request')
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
Expand All @@ -31,12 +33,8 @@ jobs:
runs-on: ubuntu-latest
needs: detect-ci-trigger
if: |
always()
&& github.repository == 'pydata/xarray'
&& (
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
|| needs.detect-ci-trigger.outputs.triggered == 'true'
)
defaults:
run:
shell: bash -l {0}
Expand Down Expand Up @@ -97,9 +95,7 @@ jobs:
name: report
needs: upstream-dev
if: |
always()
&& github.event_name == 'schedule'
&& github.repository == 'pydata/xarray'
github.event_name == 'schedule'
&& needs.upstream-dev.outputs.artifacts_availability == 'true'
runs-on: ubuntu-latest
defaults:
Expand Down

0 comments on commit 60e3963

Please sign in to comment.