diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index a14a430..c2f5e39 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -2,6 +2,8 @@ name: Validate existing links on: push: + branches-ignore: + - live repository_dispatch: workflow_dispatch: schedule: @@ -16,13 +18,19 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Resolve root-relative links for checking + run: | + # Convert root-relative markdown links like [text](/path) to [text](https://learn.microsoft.com/path) + # so lychee can validate them. This only modifies the CI checkout copy. + find . -name '*.md' -exec sed -i -E 's|\]\(/|\](https://learn.microsoft.com/|g' {} + + - name: Link Checker id: lychee uses: lycheeverse/lychee-action@master env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} with: - args: --accept=200,429,403,502,503 --verbose --no-progress './**/*.md' + args: --config=.lychee.toml --accept=200,429,403,502,503 --verbose --no-progress './**/*.md' fail: true - name: Create Issue From File diff --git a/.lychee.toml b/.lychee.toml new file mode 100644 index 0000000..dcf3a7e --- /dev/null +++ b/.lychee.toml @@ -0,0 +1,2 @@ +# Lychee link checker configuration +# https://github.com/lycheeverse/lychee/blob/master/lychee.example.toml