Skip to content
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

Move to Linkspector #96

Merged
merged 10 commits into from
Jan 20, 2025
35 changes: 31 additions & 4 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,42 @@
# SPDX-License-Identifier: MIT
#

name: Check README Links
name: Check Links

on:
workflow_call:

jobs:
markdown_link_check:
name: Check Links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Markdown Link Check
uses: gaurav-nelson/github-action-markdown-link-check@v1
- uses: actions/checkout@v4
- name: Linkspector Ubuntu Workaround
run: |
echo "Linkspector Ubuntu Workaround for: https://github.com/UmbrellaDocs/action-linkspector/issues/32"
echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Check and Create Linkspector Configuration
run: |
CONFIG_FILE=".linkspector.yml"
if [ ! -f "$CONFIG_FILE" ]; then
echo "Configuration file not found. Creating a new one."
echo "dirs:" >> $CONFIG_FILE
echo " - ." >> $CONFIG_FILE
echo "useGitIgnore: true" >> $CONFIG_FILE
echo "ignorePatterns:" >> $CONFIG_FILE
echo " - pattern: '^doc:.*$'" >> $CONFIG_FILE
echo "replacementPatterns:" >> $CONFIG_FILE
echo " - pattern: '(.*)#gh-dark-mode-only'" >> $CONFIG_FILE
echo " replacement: '\$1'" >> $CONFIG_FILE
echo " - pattern: '(.*)#gh-light-mode-only'" >> $CONFIG_FILE
echo " replacement: '\$1'" >> $CONFIG_FILE
else
echo "Configuration file exists. Skipping creation."
fi
echo "Contents of $CONFIG_FILE:"
cat $CONFIG_FILE
- name: Linkspector
uses: umbrelladocs/action-linkspector@v1
with:
filter_mode: nofilter
Loading