From f1a46e86235287c00c50ed2ee0edb6ae29de9b16 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Mon, 20 Jan 2025 12:07:30 -0800 Subject: [PATCH] Move to Linkspector (#96) # Move to Linkspector ## :gear: Release Notes - Replace Markdown Link check with Linkspector ### Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md). --------- Signed-off-by: Paul Schmiedmayer --- .github/workflows/markdown-link-check.yml | 35 ++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/markdown-link-check.yml b/.github/workflows/markdown-link-check.yml index 8ae42bc..f542427 100644 --- a/.github/workflows/markdown-link-check.yml +++ b/.github/workflows/markdown-link-check.yml @@ -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