-
Notifications
You must be signed in to change notification settings - Fork 1.1k
32 lines (32 loc) · 1.07 KB
/
validate_redirects.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Validate Redirects
on:
pull_request:
branches: [main]
types: [opened, synchronize]
env:
BUILD_DIR: 'client/www/next-build'
permissions:
contents: read
jobs:
ValidateRedirects:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Setup Node.js 20.x
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20.x
- name: Install Dependencies
run: yarn
- name: Validate redirects
id: redirects
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
result-encoding: string
script: |
const { invalidRedirects } = require('./.github/workflows/scripts/validate-redirects.js');
return await invalidRedirects();
- name: Fail if any invalid redirects have been found
if: ${{ steps.redirects.outputs.result }}
run: exit 1 && echo ${{ steps.redirects.outputs.result }}