From 51fafcdc24b18ec39848f2eec1b8fef1cb3e8a5a Mon Sep 17 00:00:00 2001 From: Daniel Holbach Date: Wed, 1 Apr 2020 11:11:06 +0200 Subject: [PATCH] better link checking, break out of #2948 - .github/workflows/markdown-link-check-config.json has some patterns we exlude while checking the markdown files in the top-level directories (company websites on README.md and billions of GH issues in CHANGELOG.md in particular) - once https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/26 is merged, we can move back to the official GH Action --- .github/workflows/docs.yaml | 16 ++++++++++++++-- .../workflows/markdown-link-check-config.json | 9 +++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/markdown-link-check-config.json diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index d752a8d2a3..0647169e58 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -14,6 +14,18 @@ jobs: python-version: [3.8] steps: - uses: actions/checkout@v2 + - name: Link Checker (for top-level markdown docs) + uses: dholbach/github-action-markdown-link-check@add-max-depth + with: + use-verbose-mode: 'yes' + config-file: '.github/workflows/markdown-link-check-config.json' + folder-path: ./ + max-depth: 1 + - name: Link Checker (for ./internal markdown docs) + uses: dholbach/github-action-markdown-link-check@add-max-depth + with: + use-verbose-mode: 'yes' + folder-path: ./internal/docs/ - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: @@ -24,10 +36,10 @@ jobs: pip install -r docs/requirements.txt - name: Build docs for link check run: mkdocs build - - name: Link Checker + - name: Link Checker (generated site) id: lc uses: peter-evans/link-checker@v1 with: - args: -r -d site/ -v site/index.html + args: -v -d ./site -r ./site - name: Fail if there were link errors run: exit ${{ steps.lc.outputs.exit_code }} diff --git a/.github/workflows/markdown-link-check-config.json b/.github/workflows/markdown-link-check-config.json new file mode 100644 index 0000000000..421a2d3a26 --- /dev/null +++ b/.github/workflows/markdown-link-check-config.json @@ -0,0 +1,9 @@ +{ + "ignorePatterns": [ + { + "githubIssuePattern": "^https://github.com/\\S+/\\S+/(issues|pull)/[0-9]+", + "mailtoPattern": "^mailto:", + "companySitesWith403sPattern": "^https://www.(blablacar|canva|underarmour).com" + } + ] +}