Update markdown-link-check.yml #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | ||
# This source file is part of the Stanford Biodesign Digital Health Group open-source organization | ||
# | ||
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md) | ||
# | ||
# SPDX-License-Identifier: MIT | ||
# | ||
name: Check Links | ||
on: | ||
workflow_call: | ||
jobs: | ||
markdown_link_check: | ||
name: Check Links | ||
runs-on: ubuntu-latest | ||
steps: | ||
- 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: \"\"" >> $CONFIG_FILE | ||
echo " - pattern: \"#gh-light-mode-only\"" >> $CONFIG_FILE | ||
echo " replacement: \"\"" >> $CONFIG_FILE | ||
else | ||
echo "Configuration file exists. Skipping creation." | ||
fi | ||
- name: Linkspector | ||
uses: umbrelladocs/action-linkspector@v1 | ||
with: | ||
filter_mode: nofilter |