-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.58 KB
/
broken-links-check.yaml
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
---
name: Broken links checks
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0" # Every sunday at midnight
pull_request:
branches: ["main"]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Generate Token
id: generate-token
uses: tibdex/[email protected]
with:
app_id: "${{ secrets.BOT_APP_ID }}"
private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Checkout repo
uses: actions/checkout@v4
- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Scan for broken links
uses: lycheeverse/lychee-action@v1
id: lychee
env:
GITHUB_TOKEN: "${{ steps.generate-token.outputs.token }}"
with:
args: >
--cache
--max-cache-age 1d
--verbose
--exclude-mail
'./**/*.md' './**/*.tf'
- name: Find Broken links issues
id: broken-link-check-issue
uses: micalevisk/last-issue-action@v2
with:
state: open
labels: |
broken-links
- name: Update issues
uses: peter-evans/create-issue-from-file@v5
with:
title: Broken links detected 🔗
issue-number: "${{ steps.broken-link-check-issue.outputs.issue-number }}"
content-filepath: ./lychee/out.md
token: "${{ steps.generate-token.outputs.token }}"
labels: |
broken-links