diff --git a/README.md b/README.md index 3e05cb3..4a640bf 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,5 @@ https://github.com/Consensys/github-actions acts as a single source of truth (sot) for actions that we use +# TODO +- Add lint checks on this repo \ No newline at end of file diff --git a/docs-link-check/action.yml b/docs-link-check/action.yml index 6b80f74..03f0ea1 100644 --- a/docs-link-check/action.yml +++ b/docs-link-check/action.yml @@ -25,11 +25,40 @@ runs: repository: Consensys/github-actions path: .github-actions - # also needs reviewdog/action-setup@v1 - # reviewdog/action-setup@d8edfce3dd5e1ec6978745e801f9c50b5ef80252 - - name: Test links - uses: umbrelladocs/action-linkspector@652f85bc57bb1e7d4327260decc10aa68f7694c3 + - name: Read .nvmrc + shell: bash + run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT + id: nvm + + - name: Use Node.js + uses: actions/setup-node@v6 with: - config_file: ${{ inputs.CONFIG_FILE }} - fail_level: ${{ inputs.FAIL_LEVEL }} - filter_mode: ${{ inputs.FILTER_MODE }} + registry-url: https://registry.npmjs.org/ + node-version-file: '.nvmrc' + + # Fix Chrome sandbox issues on Ubuntu 24.04 + - name: Setup Chrome Linux Sandbox + shell: bash + run: | + # Based on https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md + if [ "$(lsb_release -rs)" = "24.04" ]; then + echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns + echo 'Done' + else + echo "Not running on Ubuntu 24.04 — skipping sandbox fix" + fi + + - name: Install linkspector + shell: bash + run: | + npm install -g @umbrelladocs/linkspector + echo 'linkspector version: $(linkspector --version)' + + # Run linkspector and fail if there are broken links + - name: Run linkspector + shell: bash + run: | + set -eo pipefail + echo "🔍 Checking for broken links..." + linkspector check -c ${{ inputs.CONFIG_FILE }} +