-
Notifications
You must be signed in to change notification settings - Fork 8
75 lines (66 loc) · 2.17 KB
/
Copy pathnetlicensing-jekyll-lint.yml
File metadata and controls
75 lines (66 loc) · 2.17 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Lint NetLicensing.IO
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache Jekyll build
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/_site
${{ github.workspace }}/.jekyll-cache
key: jekyll-${{ runner.os }}-${{ hashFiles('**/_config.yml', '**/Gemfile.lock') }}
restore-keys: |
jekyll-${{ runner.os }}-
- name: Build Jekyll site
run: |
docker run --rm \
-v "${{ github.workspace }}:/srv/jekyll" \
-v "${{ github.workspace }}/_site:/srv/jekyll/_site" \
jekyll/builder:4.2.2 \
/bin/bash -c "chmod 777 /srv/jekyll && jekyll build --future --strict_front_matter"
- name: Run HTMLProofer
run: |
set -o pipefail
docker run --rm \
-v "${{ github.workspace }}/_site:/site" \
ghcr.io/chabad360/htmlproofer:5.0.8 \
/site \
--checks "Links,Images,Scripts,OpenGraph" \
--allow-hash-href \
--log-level info \
--ignore-urls "/^(?:mailto:|tel:)/" \
--ignore-status-codes "0,429" \
--no-enforce-https \
--typhoeus '{"connecttimeout": 10, "timeout": 30}' \
--cache '{"timeframe": {"external": "1d"}}' \
2>&1 | tee /tmp/htmlproofer.log
htmlproofer_exit_code=$?
# Write summary
{
echo "## HTMLProofer Results"
echo ""
if [ "$htmlproofer_exit_code" -ne 0 ]; then
echo "⚠️ Issues found — review before merging."
else
echo "✅ No issues found."
fi
echo ""
echo "<details><summary>Full output</summary>"
echo ""
echo '```'
cat /tmp/htmlproofer.log
echo '```'
echo ""
echo "</details>"
} >> "$GITHUB_STEP_SUMMARY"
exit "$htmlproofer_exit_code"