-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (49 loc) · 1.82 KB
/
check_links.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Check broken links
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
jobs:
check-links:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-22.04
steps:
- name: Waiting for 200 from the Vercel Preview
uses: patrickedqvist/[email protected]
id: waitForVercel
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 720
check_interval: 60
allow_inactive: true
environment: Preview
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Check for broken links
if: steps.waitForVercel.outputs.url
uses: lycheeverse/[email protected]
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
args: --max-redirects 10 --exclude-mail --base ${{ steps.waitForVercel.outputs.url }} './src/content/docs/en/**/*.mdx'
fail: true
check-live-links:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Lychee Broken Link Checker
if: github.ref == 'refs/heads/main'
uses: lycheeverse/[email protected]
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
args: --max-redirects 10 --exclude-mail --base https://dev.adjust.com './src/content/docs/en/**/*.mdx'
fail: true
- name: Create issue to fix broken links
# Don't run this step for pull requests. We don't want to generate an issue every time!
if: ${{ failure() && env.lychee_exit_code != 0 && github.event_name != 'pull_request' }}
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue