88 description : ' default config file.'
99 required : false
1010 default : .github-actions/docs-link-check/config/.linkspector.yml
11- FAIL_LEVEL :
12- description : ' exit code for reviewdog when errors are found with severity greater than or equal to this level'
13- required : false
14- default : ' any'
15- FILTER_MODE :
16- description : ' filtering mode for reviewdog command'
17- required : false
18- default : ' nofilter'
1911runs :
2012 using : " composite"
2113 steps :
@@ -25,11 +17,40 @@ runs:
2517 repository : Consensys/github-actions
2618 path : .github-actions
2719
28- # also needs reviewdog/action-setup@v1
29- # reviewdog/action-setup@d8edfce3dd5e1ec6978745e801f9c50b5ef80252
30- - name : Test links
31- uses : umbrelladocs/action-linkspector@652f85bc57bb1e7d4327260decc10aa68f7694c3
20+ - name : Read .nvmrc
21+ shell : bash
22+ run : echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
23+ id : nvm
24+
25+ - name : Use Node.js
26+ uses : actions/setup-node@v6
3227 with :
33- config_file : ${{ inputs.CONFIG_FILE }}
34- fail_level : ${{ inputs.FAIL_LEVEL }}
35- filter_mode : ${{ inputs.FILTER_MODE }}
28+ registry-url : https://registry.npmjs.org/
29+ node-version-file : ' .nvmrc'
30+
31+ # Fix Chrome sandbox issues on Ubuntu 24.04
32+ - name : Setup Chrome Linux Sandbox
33+ shell : bash
34+ run : |
35+ # Based on https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
36+ if [ "$(lsb_release -rs)" = "24.04" ]; then
37+ echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
38+ echo 'Done'
39+ else
40+ echo "Not running on Ubuntu 24.04 — skipping sandbox fix"
41+ fi
42+
43+ - name : Install linkspector
44+ shell : bash
45+ run : |
46+ npm install -g @umbrelladocs/linkspector @umbrelladocs/rdformat-validator
47+ echo "linkspector version: $(node ${{ github.action_path }}/scripts/run-linkinspector.mjs --version)"
48+
49+ # Run linkspector and fail if there are broken links
50+ - name : Run linkspector
51+ shell : bash
52+ run : |
53+ set -eo pipefail
54+ echo "🔍 Checking for broken links..."
55+ node ${{ github.action_path }}/scripts/run-linkinspector.mjs check -c ${{ inputs.CONFIG_FILE }}
56+
0 commit comments