forked from JesperDramsch/python-deadlines
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.63 KB
/
Copy pathlink-check.yml
File metadata and controls
59 lines (51 loc) · 1.63 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
51
52
53
54
55
56
57
58
59
name: Check Links
on:
schedule:
# Weekly on Sundays at 6 AM UTC (quiet time for most services)
- cron: '0 6 * * 0'
workflow_dispatch: # Manual trigger from Actions tab
push:
paths:
- '_data/conferences.yml'
concurrency:
group: link-check
cancel-in-progress: true
permissions:
contents: read
issues: write
jobs:
check-links:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Restore lychee cache
uses: actions/cache@v6
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
args: --config .lychee.toml _data/conferences.yml
fail: false # Don't fail workflow on broken links
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Find existing broken links issue
if: steps.lychee.outputs.exit_code != 0
id: find_issue
env:
GH_TOKEN: ${{ github.token }}
run: |
ISSUE=$(gh issue list --label broken-links --state open --json number -q '.[0].number' 2>/dev/null || echo "")
echo "number=${ISSUE}" >> $GITHUB_OUTPUT
- name: Create or update broken links issue
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v6
with:
title: "🔗 Broken links detected"
content-filepath: ./lychee/out.md
labels: automated,broken-links
issue-number: ${{ steps.find_issue.outputs.number }}