-
Notifications
You must be signed in to change notification settings - Fork 11
linkchecker via npm package #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this still allow optionally configuring the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.) |
||
|
|
||
There was a problem hiding this comment.
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.