The pr-check-redirects
reusable action is located at .github/workflows/pr-check-redirects.yml
.
This workflow uses the Yari content validate-redirects
utility to validate the redirects file(s). You can use the paths
filter to trigger this workflow only for specific files or file patterns. More on this in the usage section.
This reusable action depends on the following actions:
The action has the following inputs:
Specify the target repository this action should run on. This is used to prevent actions from running on repositories other than the target repository. For example, specifying a target-repo
of mdn/workflows
will prevent the action from running on forks of mdn/workflows
.
- This
input
is required
The package manager cache to use.
- This
input
is optional, with the default valueyarn
.
The node version to setup and use.
- This
input
is optional, with the default value16
.
The target locale for which to check the redirects file(s).
- This
input
is optional. The default is all locales in the repository.
This will run for all locales in the target repository.
name: check-redirects
on:
pull_request:
branches:
- main
paths:
- files/**
- .github/workflows/pr-check-redirects.yml
jobs:
check-redirects:
uses: mdn/workflows/.github/workflows/pr-check-redirects.yml@main
with:
target-repo: "mdn/workflows"
Only run this for the en-us
locale, using npm
cache and Nodejs version 18
.
name: check-redirects
on:
pull_request:
branches:
- main
paths:
- files/**
- .github/workflows/pr-check-redirects.yml
jobs:
check-redirects:
uses: mdn/workflows/.github/workflows/pr-check-redirects.yml@main
with:
cahce: "npm"
node-version: 18
target-locale: "en-us"
target-repo: "mdn/workflows"