CI: Avoid path filtering in "required" workflows #3
Workflow file for this run
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
name: Check _redirects.txt file | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check-redirects: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
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 : | |
- "files/en-us/_redirects.txt" | |
- ".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 |