Skip to content

Commit 547dc7d

Browse files
jasonjohCopilot
andauthored
Added path filter to validate.yml (#1242)
* Added path filter to validate.yml So now the validation will only run if relevant files are changed. There's no reason to run validation on sample queries if only permissions files are changed, for example. Also added an opposite-filtered version of the workflow in validate-patch.yml. This will allow us to make this a required status check on PRs without blocking PRs that don't touch relevant files. See https://github.com/orgs/community/discussions/44490 for context. * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent d8aa1f9 commit 547dc7d

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file mirrors validate.yml and is designed to be a
2+
# "stand-in" that always passes so that pull requests are not
3+
# blocked waiting on the "Validate sample queries" workflow.
4+
# For context, validate.yml will only run if specific files are
5+
# updated in the PR. If a PR doesn't touch any of those files,
6+
# validate.yml will never run, but since it's a required status
7+
# check for PRs, the PR will be stuck waiting for the workflow to run.
8+
# This file solves that problem. For more info, see
9+
# https://github.com/orgs/community/discussions/44490
10+
name: Validate sample queries
11+
on:
12+
pull_request:
13+
paths-ignore:
14+
- sample-queries/sample-queries.json
15+
- scripts/**
16+
- tests/**
17+
- package.json
18+
- package-lock.json
19+
20+
jobs:
21+
validate-json-schema:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- run: 'echo "No validation required"'
25+
26+
test:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- run: 'echo "No tests required"'

.github/workflows/validate.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
name: Validate sample queries
2-
on: [pull_request,push]
2+
on:
3+
push:
4+
paths:
5+
- sample-queries/sample-queries.json
6+
- scripts/**
7+
- tests/**
8+
- package.json
9+
- package-lock.json
10+
pull_request:
11+
paths:
12+
- sample-queries/sample-queries.json
13+
- scripts/**
14+
- tests/**
15+
- package.json
16+
- package-lock.json
317

418
jobs:
519
validate-json-schema:
@@ -18,8 +32,8 @@ jobs:
1832
steps:
1933
- uses: actions/checkout@v2
2034

21-
- name: Install
22-
run: npm install
35+
- name: Install
36+
run: npm install
2337

2438
- name: Run test
2539
run: npm run test

0 commit comments

Comments
 (0)