Skip to content

Commit 5f1cdc6

Browse files
Add PAT auth for contract test to avoid rate limits
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 34b8cd5 commit 5f1cdc6

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ jobs:
5656

5757
- name: Run tests
5858
run: npm test
59+
env:
60+
API_CONTRACT_TEST_PAT: ${{ secrets.API_CONTRACT_TEST_PAT }}
5961

6062
- name: Upload Chrome extension
6163
uses: actions/upload-artifact@v4

tests/extension.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ test.describe('', () => {
140140
test('GitHub API contract', async () => {
141141
const issue = TEST_ISSUES[0];
142142
const url = `https://api.github.com/repos/${issue.owner}/${issue.repo}/issues/${issue.number}`;
143-
const response = await fetch(url);
143+
const headers = {};
144+
if (process.env.API_CONTRACT_TEST_PAT) {
145+
headers['Authorization'] = `Bearer ${process.env.API_CONTRACT_TEST_PAT}`;
146+
}
147+
const response = await fetch(url, { headers });
144148
expect(response.ok).toBe(true);
145149

146150
const data = await response.json();

0 commit comments

Comments
 (0)