Skip to content

Commit c60c0eb

Browse files
authored
Improve workflow filters (#1668)
Run the ci_workflow and website_workflow only on changes to the appropriate source files and workflow files. Signed-off-by: Cary Phillips <[email protected]>
1 parent f0da5b7 commit c60c0eb

File tree

2 files changed

+16
-26
lines changed

2 files changed

+16
-26
lines changed

.github/workflows/ci_workflow.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,35 @@
66

77
name: CI
88

9-
# Skip the run on *.md changes and on changes to the website, *except*
10-
# for "website/src", since that code needs validation. There's a
11-
# separate workflow for with website. Also, no need to run on changes
12-
# to the bazel setup.
9+
# Run on all changes except:
10+
# - doc file changes
11+
# - changes to the website, *except* for "website/src", since that
12+
# code needs validation. The website has a separate workflow
13+
# - changes to the bazel config, since it has its own workflow
14+
# - changes to the python bindings
15+
# - changes to workflows other than this one
1316

1417
on:
1518
push:
16-
branches-ignore:
17-
- RB-2.*
18-
tags-ignore:
19-
- v1.*
20-
- v2.*
2119
paths:
2220
- '**'
2321
- '!**.md'
2422
- '!website/**'
2523
- 'website/src/**'
2624
- '!bazel/**'
2725
- '!src/wrappers/**'
28-
- '!.github/workflows/python-**.yml'
26+
- '!.github/workflows/**'
27+
- '.github/workflows/ci_workflow.yml'
2928
pull_request:
30-
branches-ignore:
31-
- RB-2.*
32-
tags-ignore:
33-
- v1.*
34-
- v2.*
3529
paths:
3630
- '**'
3731
- '!**.md'
3832
- '!website/**'
3933
- 'website/src/**'
4034
- '!bazel/**'
4135
- '!src/wrappers/**'
42-
- '!.github/workflows/python-**.yml'
36+
- '!.github/workflows/**'
37+
- '.github/workflows/ci_workflow.yml'
4338

4439
permissions:
4540
contents: read

.github/workflows/website_workflow.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,24 @@
66

77
name: Website
88

9-
# Run only on changes in the "website" directory.
9+
# Run only on changes in the "website" directory or workflow file.
1010
# Skip the release branches, since the website is built from main.
1111

1212
on:
13-
workflow_dispatch:
1413

1514
push:
1615
branches:-ignore:
17-
- RB-2.*
18-
- RB-3.*
19-
tags-ignore:
20-
- v3.[0-9]+.[0-9]+-rc*
16+
- RB-*
2117
paths:
2218
- 'website/**'
19+
- '.github/workflows/website_workflow.yml'
2320

2421
pull_request:
2522
branches:-ignore:
26-
- RB-2.*
27-
- RB-3.*
28-
tags-ignore:
29-
- v3.[0-9]+.[0-9]+-rc*
23+
- RB-*
3024
paths:
3125
- 'website/**'
26+
- '.github/workflows/website_workflow.yml'
3227

3328
permissions:
3429
contents: read

0 commit comments

Comments
 (0)