links #300
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
name: links | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
schedule: | |
- cron: "30 8 * * *" | |
jobs: | |
linkChecker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download Exclude Path | |
run: | | |
curl https://raw.githubusercontent.com/devstream-io/devstream/main/.lycheeignore --output .lycheeignore | |
# replace site base url to build MkDocs in local | |
- name: Replace Base URL | |
run: | | |
sed -i 's|https://docs.devstream.io|http://localhost|g' mkdocs.yml | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install MkDocs and dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r docs/requirements.txt | |
- name: Build MkDocs | |
run: mkdocs build | |
- name: Check Links | |
uses: lycheeverse/lychee-action@v1.5.0 | |
with: | |
# For parameter description, see https://github.com/lycheeverse/lychee#commandline-parameters | |
# -E, --exclude-all-private Exclude all private IPs from checking. | |
# -v, --verbose Verbose program output | |
# -i, --insecure Proceed for server connections considered insecure (invalid TLS) | |
# -n, --no-progress Do not show progress bar. | |
# -t, --timeout <timeout> Website timeout in seconds from connect to response finished [default:20] | |
# --max-concurrency <max-concurrency> Maximum number of concurrent network requests [default: 128] | |
# -a --accept <accept> Comma-separated list of accepted status codes for valid links | |
# ./site the MkDocs site directory to check | |
# ./*.md all markdown files in the root directory | |
args: -E -v -i -n -t 45 --max-concurrency 64 -a 429,401 -- 'site' '*.md' | |
output: out.md | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Create Issue From File | |
uses: peter-evans/create-issue-from-file@v3 | |
with: | |
title: Broken Link Detected | |
content-filepath: out.md | |
# assignees: aFlyBird0 |