-
Notifications
You must be signed in to change notification settings - Fork 164
75 lines (63 loc) · 1.87 KB
/
link-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
name: Link checker
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
schedule:
- cron: 0 0 * * 0
concurrency:
group: links-checker
cancel-in-progress: true
jobs:
link-checker:
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
pull-requests: write
steps:
- 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: Attach WireGuard connection
shell: bash
run: |
sudo apt install resolvconf
sudo apt install wireguard
echo "${{ secrets.WIREGUARD_CONFIG }}" > wg0.conf
sudo chmod 600 wg0.conf
sudo wg-quick up ./wg0.conf
- name: Run lychee
uses: lycheeverse/lychee-action@v2.2.0
id: lychee
with:
args: "--base . --cache --max-cache-age 1d ."
- name: Detach WireGuard connection
shell: bash
if: always()
run: sudo wg-quick down ./wg0.conf
- name: Create issue
if: always() && github.event_name != 'pull_request' && steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: 🔗✅ Link checker report
labels: |
🐛 bug
🔗 link checker
good first issue
help wanted
hacktoberfest
content-filepath: ./lychee/out.md
- name: Update PR with comment
uses: mshick/add-pr-comment@v2
if: always() && github.event_name == 'pull_request' && steps.lychee.outputs.exit_code != 0
with:
refresh-message-position: true
message-id: 'link-checker-result'
message-path: ./lychee/out.md