Skip to content

Commit c3c1c1e

Browse files
committed
Use token for GH link checking
1 parent 3078694 commit c3c1c1e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/sphinx-build-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ jobs:
3636
cd docs
3737
# Run linkcheck builder to find broken links
3838
python -m sphinx -b linkcheck . _build/linkcheck
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs/conf.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,15 @@ def setup(app):
182182
r"http://libLLVM\.so.*",
183183
r"http://slang\.so.*",
184184
]
185-
linkcheck_rate_limit_timeout = 30.0
186185
linkcheck_report_timeouts_as_broken = True
187-
linkcheck_retries = 3
188-
linkcheck_workers = 1
186+
187+
# Configure request headers for authentication
188+
linkcheck_request_headers = {
189+
"https://github.com/*": {
190+
"Authorization": f"token {os.environ.get('GITHUB_TOKEN', '')}",
191+
"User-Agent": "Slang-Documentation-Linkcheck/1.0"
192+
}
193+
}
189194

190195
# -- Options for HTML output -------------------------------------------------
191196
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

0 commit comments

Comments
 (0)