Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
43 changes: 36 additions & 7 deletions docs-link-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Shell command substitution blocked by quoting.

The echo statement uses single quotes around the command substitution, which prevents the shell from executing the command. It will print the literal string "linkspector version: $(linkspector --version)" instead of showing the actual version. Should use double quotes or no quotes to allow command substitution.

Fix in Cursor Fix in Web


# 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 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still allow optionally configuring the FAIL_LEVEL and FILTER_MODE for the linkspector action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can put that in when I add in the build checks so it is similar to the last one - from memory that was for reviewdog but I'll dig into the levels to keep it compatible

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right it looks like it is for reviewdog (https://github.com/UmbrellaDocs/action-linkspector?tab=readme-ov-file#action-inputs). Without those settings, I wonder how this action will behave specifically for the filter mode (flagging errors for all changed files, added files only, etc.)