Skip to content

Commit a94a4cf

Browse files
committed
ci: authenticate the cpp-linter API requests
--files-changed-only makes cpp-linter query the commit through the REST API. With no token it uses the anonymous budget, which is 60 requests per hour shared across every job on the runner's IP, so it fails outright whenever that is already spent: response returned 403 from GET .../commits/10568eedaac4 API rate limit exceeded for 52.150.29.102. cpp_linter/rest_api/github_api.py reads GITHUB_TOKEN and sends it as an Authorization header, which puts the request on this repository's own budget instead.
1 parent 3de6067 commit a94a4cf

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/clang-tidy-format.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ jobs:
2121
with:
2222
submodules: recursive
2323
- name: Run C/C++ Linter
24+
env:
25+
# --files-changed-only makes cpp-linter ask the API which lines the
26+
# commit touched. Unauthenticated it shares the 60/hour anonymous
27+
# budget for the whole runner IP, which other jobs routinely exhaust:
28+
# response returned 403 from GET .../commits/<sha>
29+
# API rate limit exceeded for 52.150.29.102.
30+
# cpp_linter/rest_api/github_api.py sends this as an Authorization
31+
# header when set, moving the request onto the repo's own budget.
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2433
run: |
2534
ml StdEnv
2635
. /home/chipStarUser/venv/bin/activate

0 commit comments

Comments
 (0)