File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,8 @@ jobs:
125125 linkcheck :
126126 name : Link Check
127127 runs-on : ubuntu-latest
128+ permissions :
129+ contents : read
128130 steps :
129131 - uses : actions/checkout@v4
130132 with :
@@ -139,6 +141,8 @@ jobs:
139141 - name : Install dependencies
140142 run : just install
141143 - name : Build docs
144+ env :
145+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
142146 run : just docs-linkcheck
143147
144148 typing :
Original file line number Diff line number Diff line change 44# This file is execfile()d with the current directory set to its containing dir.
55from __future__ import annotations
66
7+ import os
78import sys
89from pathlib import Path
910
9192 r"https://sourceforge.net/" ,
9293]
9394
95+ # Add GitHub auth if available to avoid rate limiting.
96+ if "GH_TOKEN" in os .environ :
97+ token = os .environ ["GH_TOKEN" ]
98+ linkcheck_request_headers = {r"https://github.\.com/.+" : {"authorization" : f"Bearer ${ token } " }}
99+
100+ # Allow for flakey links.
101+ linkcheck_retries = 2
102+
94103# -- Options for extensions ----------------------------------------------------
95104autoclass_content = "init"
96105
You can’t perform that action at this time.
0 commit comments