Skip to content

Commit 1b878b4

Browse files
janeyx99pytorchmergebot
authored andcommitted
Add a consistent check API step so we can track our usage (#77998)
Followup action to our API Limit SEV: #77194 I added this to the upload-test-stats workflow because that one has repo secret access and is run regularly enough to be able to capture the API usage situation. The next step in the future will be to log our usage to Rockset so we can see a trend + better preempt this. Pull Request resolved: #77998 Approved by: https://github.com/malfet
1 parent a9a99a9 commit 1b878b4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/upload-test-stats.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,14 @@ jobs:
3333
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
3434
WORKFLOW_RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt }}
3535
run: python3 tools/stats/upload_test_stats.py --workflow-run-id "${WORKFLOW_RUN_ID}" --workflow-run-attempt "${WORKFLOW_RUN_ATTEMPT}"
36+
37+
check-api-rate:
38+
if: ${{ always() }}
39+
runs-on: [self-hosted, linux.2xlarge]
40+
continue-on-error: true
41+
steps:
42+
- name: Get our GITHUB_TOKEN API limit usage
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
run: |
46+
curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/rate_limit

0 commit comments

Comments
 (0)