CI: Avoid path filtering in "required" workflows #6
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 "required" 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 filtering mechanism to run the checks only if required files are modified. | |
- uses: dorny/paths-filter@v2 | |
name: See if any file needs checking | |
id: filter | |
with: | |
filters: | | |
required_files : | |
- ".nvmrc" | |
- "files/**" | |
- ".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 |