Skip to content

Commit d7ec5d9

Browse files
authored
fix(ci): stop e2e workflows triggering on docs-only changes (tldraw#8902)
In order to stop the dotcom, examples, and perf e2e workflows from running on PRs that don't touch their dependencies (for example, docs-only PRs or markdown-only changes inside `packages/`), this PR splits each workflow's relevance check into two `dorny/paths-filter` steps and ANDs the results in the job's `outputs:` expression. Closes tldraw#8878 ### Why the previous filter misbehaved `dorny/paths-filter@v3` defaults to `predicate-quantifier: some`, so the filter returns `true` if **any** listed pattern matches. Under that quantifier, a negation like `!**/*.md` matches every file that isn't a `.md` — including `.mdx` files. A docs-only change to `apps/docs/content/releases/next.mdx` therefore matched `!**/*.md` and tripped the filter, even though no positive include matched it. ### Why one filter isn't enough `dorny/paths-filter` only supports `predicate-quantifier: some | every` (it's a per-step option, not per-filter). Under `every`, every listed pattern must match for a file to count, which doesn't combine with multiple positive includes like `packages/**` **or** `apps/dotcom/**` — no single file is in both. So we use two steps and combine. ### How the new check works Per workflow: - `includes` (default `some`): true if any changed file is in a relevant path (`packages/**`, `apps/dotcom/**` or `apps/examples/**`, the workflow file itself, `.github/actions/**`, `yarn.lock`). - `nondocs` (`predicate-quantifier: 'every'` with `['**', '!**/*.md', '!**/*.mdx']`): a file is included only if it matches `**` and is not `.md` and not `.mdx`, so the filter is true iff at least one non-markdown file changed. `relevant = includes && nondocs`, evaluated in the job's `outputs:` expression. Behavior: | PR contents | `includes` | `nondocs` | `relevant` | | --- | --- | --- | --- | | `apps/docs/content/foo.mdx` only | false | false | **false** (skip) | | `packages/foo/README.md` only | true | false | **false** (skip) | | `packages/foo/src/index.ts` only | true | true | **true** (run) | | `packages/foo/src/index.ts` + `apps/docs/foo.mdx` | true | true | **true** (run, code change wins) | ### Change type - [x] `other` ### Test plan 1. Open a PR that only changes `apps/docs/content/releases/next.mdx`. Confirm each of `End to end tests (dotcom)`, `End to end tests (examples)`, and `End to end tests (perf)` reports both filter steps and resolves `relevant = false`, and the matching `build` job is skipped. 2. Open a PR that only changes a `packages/**/README.md`. Confirm the same three workflows skip the `build` job (`includes = true`, `nondocs = false`). 3. Open a PR that changes a relevant code file (e.g. anything under `packages/<x>/src/`, `apps/dotcom/`, `apps/examples/`, the workflow file, `.github/actions/`, or `yarn.lock`). Confirm the corresponding e2e workflow still runs. 4. Open a PR that mixes a code change with a docs/markdown change. Confirm the workflow still runs (the code change satisfies `nondocs`). ### Release notes - Internal CI fix; no user-facing changes.
1 parent 3df7177 commit d7ec5d9

3 files changed

Lines changed: 39 additions & 12 deletions

File tree

.github/workflows/playwright-dotcom.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,31 @@ jobs:
2121
runs-on: ubuntu-latest
2222
if: ${{ github.event.pull_request.head.repo.fork == false }}
2323
outputs:
24-
relevant: ${{ steps.filter.outputs.relevant }}
24+
relevant: ${{ steps.includes.outputs.match == 'true' && steps.nondocs.outputs.match == 'true' }}
2525
steps:
2626
- name: Check out code
2727
uses: actions/checkout@v6
2828

29-
- name: Check for relevant changes
29+
- name: Check for changes to relevant paths
3030
uses: dorny/paths-filter@v3
31-
id: filter
31+
id: includes
3232
with:
3333
filters: |
34-
relevant:
34+
match:
3535
- 'packages/**'
3636
- 'apps/dotcom/**'
3737
- '.github/workflows/playwright-dotcom.yml'
3838
- '.github/actions/**'
3939
- 'yarn.lock'
40+
41+
- name: Check for any non-doc changes
42+
uses: dorny/paths-filter@v3
43+
id: nondocs
44+
with:
45+
predicate-quantifier: 'every'
46+
filters: |
47+
match:
48+
- '**'
4049
- '!**/*.md'
4150
- '!**/*.mdx'
4251

.github/workflows/playwright-examples.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,31 @@ jobs:
1919
name: 'Check for relevant changes'
2020
runs-on: ubuntu-latest
2121
outputs:
22-
relevant: ${{ steps.filter.outputs.relevant }}
22+
relevant: ${{ steps.includes.outputs.match == 'true' && steps.nondocs.outputs.match == 'true' }}
2323
steps:
2424
- name: Check out code
2525
uses: actions/checkout@v6
2626

27-
- name: Check for relevant changes
27+
- name: Check for changes to relevant paths
2828
uses: dorny/paths-filter@v3
29-
id: filter
29+
id: includes
3030
with:
3131
filters: |
32-
relevant:
32+
match:
3333
- 'packages/**'
3434
- 'apps/examples/**'
3535
- '.github/workflows/playwright-examples.yml'
3636
- '.github/actions/**'
3737
- 'yarn.lock'
38+
39+
- name: Check for any non-doc changes
40+
uses: dorny/paths-filter@v3
41+
id: nondocs
42+
with:
43+
predicate-quantifier: 'every'
44+
filters: |
45+
match:
46+
- '**'
3847
- '!**/*.md'
3948
- '!**/*.mdx'
4049

.github/workflows/playwright-perf.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,31 @@ jobs:
1919
name: 'Check for relevant changes'
2020
runs-on: ubuntu-latest
2121
outputs:
22-
relevant: ${{ steps.filter.outputs.relevant }}
22+
relevant: ${{ steps.includes.outputs.match == 'true' && steps.nondocs.outputs.match == 'true' }}
2323
steps:
2424
- name: Check out code
2525
uses: actions/checkout@v6
2626

27-
- name: Check for relevant changes
27+
- name: Check for changes to relevant paths
2828
uses: dorny/paths-filter@v3
29-
id: filter
29+
id: includes
3030
with:
3131
filters: |
32-
relevant:
32+
match:
3333
- 'packages/**'
3434
- 'apps/examples/**'
3535
- '.github/workflows/playwright-perf.yml'
3636
- '.github/actions/**'
3737
- 'yarn.lock'
38+
39+
- name: Check for any non-doc changes
40+
uses: dorny/paths-filter@v3
41+
id: nondocs
42+
with:
43+
predicate-quantifier: 'every'
44+
filters: |
45+
match:
46+
- '**'
3847
- '!**/*.md'
3948
- '!**/*.mdx'
4049

0 commit comments

Comments
 (0)