Skip to content

Commit b2a1337

Browse files
adamluibvolpato
andcommitted
Create validate-links-on-push-pr
Co-Authored-By: Bruno Volpato <3207647+bvolpato@users.noreply.github.com>
1 parent bd1cda6 commit b2a1337

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Validate links on push + PR
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
lychee:
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v6.0.2
21+
22+
- name: Restore lychee cache
23+
id: restore-cache
24+
uses: actions/cache/restore@v5.0.4
25+
with:
26+
path: .lycheecache
27+
key: cache-lychee-${{ github.sha }}
28+
restore-keys: cache-lychee-
29+
30+
- name: Validate links
31+
uses: lycheeverse/lychee-action@v2.8.0
32+
with:
33+
# Check all files, ignore ok/redir/blocked/rate-limited
34+
args: >-
35+
. --no-progress
36+
--accept 200..299,300..399,403,429
37+
--cache --max-cache-age 3d
38+
env:
39+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
40+
41+
- name: Save lychee cache
42+
uses: actions/cache/save@v5.0.4
43+
if: always()
44+
with:
45+
path: .lycheecache
46+
key: ${{ steps.restore-cache.outputs.cache-primary-key }}

0 commit comments

Comments
 (0)