Skip to content

Commit 4839f59

Browse files
ci: validate newly added documentation links
Signed-off-by: John Finnerty <297514060+johnfinnerty-nz@users.noreply.github.com>
1 parent cee95c2 commit 4839f59

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎.github/workflows/pr-preview-links.yml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ jobs:
1717
documentation-links:
1818
runs-on: ubuntu-latest
1919
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Extract links added by the pull request
25+
run: |
26+
git diff --unified=0 "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" -- '*.md' '*.rst' \
27+
| grep -Eo 'https?://[^ )>]+' | sort -u > added-links.txt || true
28+
29+
- name: Check links added by the pull request
30+
uses: lycheeverse/lychee-action@v2
31+
with:
32+
args: --verbose --no-progress --exclude-mail added-links.txt
33+
fail: true
34+
2035
- uses: readthedocs/actions/preview@b8bba1484329bda1a3abe986df7ebc80a8950333 # v1.5
2136
with:
2237
project-slug: "python-packaging-user-guide"

0 commit comments

Comments
 (0)