Skip to content

Commit 81ab15f

Browse files
author
Georges Bossert
committed
fix(broken-links): init broken links checks
1 parent 9d345e7 commit 81ab15f

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Check Broken Links
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
check-broken-links:
8+
name: Check Broken Links
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout main
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Python
16+
uses: actions/setup-python@v5
17+
id: setup-python
18+
with:
19+
python-version: '3.11'
20+
21+
- name: Find Comment
22+
uses: peter-evans/find-comment@v3
23+
id: fc
24+
with:
25+
issue-number: 2034
26+
comment-author: github-actions[bot]
27+
body-includes: Found broken links
28+
29+
# install linkchecker
30+
- name: Install linkchecker
31+
run: sudo apt-get install linkchecker
32+
33+
# execute linkchecker on docs.sekoia.io
34+
- name: Check broken links
35+
run: linkchecker --check-extern --no-follow-url="!://storage.gra.cloud.ovh.net/v1/AUTH_741841e1c7da4c50a76152cbc2609bd1/sekoiaio-documentation-previews" --ignore-url="github.com/SEKOIA-IO" --ignore-url="https://storage.gra.cloud.ovh.net/v1/AUTH_741841e1c7da4c50a76152cbc2609bd1/sekoiaio-documentation-previews/${{ steps.pr_number.outputs.pr_number }}/tip/" -o csv -F csv "https://storage.gra.cloud.ovh.net/v1/AUTH_741841e1c7da4c50a76152cbc2609bd1/sekoiaio-documentation-previews/2034/getting_started/"
36+
37+
# execute python script to parse the csv file and get the broken links
38+
- name: Parse broken links
39+
run: python scripts/broken_links/create_issues.py linkchecker-out.csv
40+
41+
- name: Add comment to PR
42+
uses: peter-evans/create-or-update-comment@v4
43+
with:
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
issue-number: 2034
46+
comment-id: ${{ steps.fc.outputs.comment-id }}
47+
edit-mode: replace
48+
body: |
49+
Found broken links in preview environment !
50+
51+
52+
53+
54+
55+

0 commit comments

Comments
 (0)