-
-
Notifications
You must be signed in to change notification settings - Fork 74
50 lines (42 loc) · 1.21 KB
/
Copy pathlink-check.yml
File metadata and controls
50 lines (42 loc) · 1.21 KB
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
name: Link Check
on:
push:
pull_request:
schedule:
- cron: "0 6 * * *" # every day at 06:00 UTC
workflow_dispatch:
permissions:
contents: write
jobs:
lychee:
name: Check links and update README
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Run lychee
uses: lycheeverse/lychee-action@v1.11.0
with:
args: --config .lychee.toml --no-progress
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Link Health section in README
run: |
node scripts/update-link-health.mjs
- name: Commit changes (if any)
run: |
if [[ -n "$(git status --porcelain)" ]]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "chore: update Link Health section (automated)"
git push
else
echo "No README changes to commit."
fi