forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (72 loc) · 2.51 KB
/
links_checker.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Links Checker
on:
## Allow triggering this workflow manually via GitHub CLI/web
workflow_dispatch:
## Run this workflow automatically every week
schedule:
- cron: '0 0 * * *'
jobs:
link_checker:
name: Check links and create automated issue if needed
runs-on: ubuntu-latest
env:
LYCHEE_OUT: ./lychee/links-report
steps:
## Check out code using Git
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
- name: Check all links at *.md and doc files
id: lychee
uses: lycheeverse/[email protected]
with:
output: ${{ env.LYCHEE_OUT }}
format: markdown
## Do not fail this step on broken links
fail: false
## Allow pages replying with 200 (Ok)in at most 20 seconds
## This checks all md files in the repo
args: >-
--verbose
--accept 200
--timeout 20
--max-concurrency 10
--no-progress
'./**/*.md'
env:
## Avoid rate limiting when checking github.com links
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Find the last report issue open
uses: micalevisk/[email protected]
id: last_issue
with:
state: open
labels: |
report
automated issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create issue from report file
if: ${{ steps.last_issue.outputs.has_found == 'false' }}
uses: peter-evans/create-issue-from-file@v4
with:
title: Link checker report
content-filepath: ${{ env.LYCHEE_OUT }}
assignees: ronny-mysten, randall-Mysten, awelc, lxfind, patrickkuo
issue-number: ${{ steps.last_issue.outputs.issue_number }}
labels: |
report
automated issue
- name: Update last report open issue created
if: ${{ steps.last_issue.outputs.has_found == 'true' }}
uses: peter-evans/create-issue-from-file@v4
with:
title: Link checker report
content-filepath: ${{ env.LYCHEE_OUT }}
issue-number: ${{ steps.last_issue.outputs.issue_number }}
labels: |
report
automated issue
- name: Close last report open issue
if: ${{ steps.lychee.outputs.exit_code == 0 }}
uses: peter-evans/close-issue@v3
with:
issue-number: ${{ steps.last_issue.outputs.issue_number }}