Skip to content

Commit bc49e27

Browse files
andersy005keewis
andauthored
Trigger upstream CI on cron schedule (by default) (#4729)
Co-authored-by: keewis <keewis@users.noreply.github.com> Co-authored-by: Keewis <keewis@posteo.de>
1 parent 31d540f commit bc49e27

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
- [ ] Passes `isort . && black . && mypy . && flake8`
66
- [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst`
77
- [ ] New functions/methods are listed in `api.rst`
8+
9+
10+
<sub>By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior per commit by adding a `[test-upstream]` tag to the first line of the commit message.</sub>

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,30 @@ on:
1111
workflow_dispatch: # allows you to trigger the workflow run manually
1212

1313
jobs:
14+
detect-ci-trigger:
15+
name: detect upstream-dev ci trigger
16+
runs-on: ubuntu-latest
17+
if: github.event_name == 'push' || github.event_name == 'pull_request'
18+
outputs:
19+
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: ./.github/actions/detect-ci-trigger
23+
id: detect-trigger
24+
with:
25+
keyword: "[test-upstream]"
26+
1427
upstream-dev:
1528
name: upstream-dev
1629
runs-on: ubuntu-latest
17-
if: github.repository == 'pydata/xarray'
30+
needs: detect-ci-trigger
31+
if: |
32+
always()
33+
&& github.repository == 'pydata/xarray'
34+
&& (
35+
(github.event_name == 'scheduled' || github.event_name == 'workflow_dispatch')
36+
|| needs.detect-ci-trigger.outputs.triggered == 'true'
37+
)
1838
defaults:
1939
run:
2040
shell: bash -l {0}

0 commit comments

Comments
 (0)