File tree Expand file tree Collapse file tree 2 files changed +28
-13
lines changed
tests/check-for-internal-absolute-links Expand file tree Collapse file tree 2 files changed +28
-13
lines changed Original file line number Diff line number Diff line change 2020 - name : Run tests
2121 run : ./run-tests.sh || exit 1
2222
23- internal-links :
24- name : " Absolute Internal Links"
25- needs : build
26- runs-on : ubuntu-latest
27- steps :
28- - name : Checkout
29- uses : actions/checkout@v4
30-
31- - uses : ./.github/workflows/site-workflow
32-
33- - name : Check for internal absolute links
34- run : bash -c "! grep -REi 'https?://(www.)?opentabletdriver.net' site/_site || exit 1"
35-
3623 html-validation :
3724 name : " Validate HTML"
3825 needs : build
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ #
3+ # usage:
4+ # ./$0 "jekyll root" "html root"
5+ #
6+ # for use in CI to ensure absolute links aren't being written to html files
7+ #
8+ set -e # exit on any error
9+
10+ if [[ -z " $1 " ]]; then
11+ echo " Usage: $0 HTML_ROOT"
12+ exit 127
13+ fi
14+
15+ HTML_ROOT=" $1 "
16+
17+ ! grep -REi ' https?://(www.)?opentabletdriver.net' \
18+ --exclude=sitemap.xml \
19+ " ${HTML_ROOT} " \
20+ | grep -vE ' canonical'
21+
22+ rv=" $? "
23+
24+ if [ " $rv " -eq 0 ]; then
25+ echo " OK"
26+ else
27+ echo " FAIL"
28+ fi
You can’t perform that action at this time.
0 commit comments