Skip to content

Commit 0c1adcc

Browse files
authored
chore(ci,docs): add a github action to check links in .md, .py (#1375)
* chore(ci): add an action to check links in .md, .py * chore(ci): update cron time * chore(ci): reduce concurrency to avoid chances of getting throttled
1 parent a131180 commit 0c1adcc

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/check-links.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Links
2+
3+
on:
4+
repository_dispatch:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: "00 12 * * *"
8+
9+
jobs:
10+
linkChecker:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write # required for peter-evans/create-issue-from-file
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
16+
17+
- name: Link Checker
18+
id: lychee
19+
uses: lycheeverse/lychee-action@1d97d84f0bc547f7b25f4c2170d87d810dc2fb2c
20+
# We use --exclude '\.md(#.*)?$' to skip internal links in markdown like [See test](../tests/.../test_case.md)
21+
# otherwise we get false positives due to links pointing to content that gets generated during our mkdocs flow.
22+
# These links are checked during `mkdocs build --strict`
23+
args: lychee README.md src/**/*.py src/**/*.md tests/**/*.py tests/**/*.md docs/**/*.md --exclude '\.md(#.*)?$'
24+
with:
25+
fail: false
26+
27+
- name: Create Issue From File
28+
if: steps.lychee.outputs.exit_code != 0
29+
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd
30+
with:
31+
title: Link Checker Report
32+
content-filepath: ./lychee/out.md
33+
labels: report, automated issue

.lycheeignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
http://localhost/
2+
http://127.0.0.1:3000/
3+
https://github/
4+
ttps://github.com/%7Bself.RepositoryOwner%7D/
5+
https://api.github.com/repos/%7Bself.RepositoryOwner%7D/
6+
https://api.github.com/repos/%7Brepo%7D/releases
7+
https://github.com/ethereum/execution-spec-tests/releases/download/

0 commit comments

Comments
 (0)