-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid path filering for 'requried' workflows
- Loading branch information
1 parent
161c015
commit a4d7747
Showing
2 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,6 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- files/en-us/_redirects.txt | ||
- .github/workflows/pr-check_redirects_file.yml | ||
|
||
jobs: | ||
check-redirects: | ||
|
@@ -21,11 +18,24 @@ jobs: | |
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
||
# This is a "requried" workflow so path filtering can not be used: | ||
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks | ||
# We have to rely on a custom filering mechanism to run the checks only on required files. | ||
- uses: dorny/[email protected] | ||
id: filter | ||
with: | ||
filters: | | ||
required_files : | ||
- modified: 'files/en-us/_redirects.txt' | ||
- modified: '.github/workflows/pr-check_redirects_file.yml' | ||
- name: Install all yarn packages | ||
if: steps.filter.outputs.required_files == 'true' | ||
run: yarn --frozen-lockfile | ||
env: | ||
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Check 'files/en-us/_redirects.txt' file | ||
if: steps.filter.outputs.required_files == 'true' | ||
run: yarn content validate-redirects en-us --strict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,6 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- .nvmrc | ||
- ".github/workflows/pr-test.yml" | ||
- "files/en-us/**" | ||
|
||
jobs: | ||
tests: | ||
|
@@ -31,13 +27,27 @@ jobs: | |
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
||
# This is a "requried" workflow so path filtering can not be used: | ||
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks | ||
# We have to rely on a custom filering mechanism to run the checks only on required files. | ||
- uses: dorny/[email protected] | ||
id: filter | ||
with: | ||
filters: | | ||
required_files : | ||
- ".nvmrc" | ||
- ".github/workflows/pr-test.yml" | ||
- "files/en-us/**" | ||
- name: Install all yarn packages | ||
if: steps.filter.outputs. required_files == 'true' | ||
run: yarn --frozen-lockfile | ||
env: | ||
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get changed files | ||
if: steps.filter.outputs.required_files == 'true' | ||
run: | | ||
# Use the GitHub API to get the list of changed files | ||
# documenation: https://docs.github.com/rest/commits/commits#compare-two-commits | ||
|