Skip to content

Commit 1d8d781

Browse files
committed
fix(ci): use GITHUB_TOKEN for SDK downloads to avoid rate limits
1 parent b5c3e5c commit 1d8d781

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
uses: docker/setup-compose-action@v1.1.0
5353

5454
- name: Run Node.js tests with Node ${{ matrix.node-version }}
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5557
run: docker compose run --rm test-js
5658

5759
# Test Node.js SDK on macOS (darwin-arm64)
@@ -76,6 +78,8 @@ jobs:
7678
run: brew install go-task
7779

7880
- name: Setup project
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7983
run: task setup
8084

8185
- name: Build Node.js addon
@@ -125,6 +129,8 @@ jobs:
125129
pip install build pytest python-dotenv pybind11 scikit-build-core
126130
127131
- name: Setup SDK
132+
env:
133+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128134
run: task setup
129135

130136
- name: Build Python module
@@ -170,6 +176,8 @@ jobs:
170176
pip install build pytest python-dotenv pybind11 scikit-build-core
171177
172178
- name: Setup project
179+
env:
180+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
173181
run: task setup
174182

175183
- name: Build Python module

compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ services:
4848
context: .
4949
args:
5050
TARGET: js
51+
environment:
52+
- GITHUB_TOKEN
5153
ports:
5254
- "8080:8080"
5355
command: sh -c "task build:js && task manual:js"

scripts/check-deps.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,16 @@ function isLibDirectoryEmpty(libPath) {
6969
// Simple fetch implementation using https module for better compatibility
7070
function httpsGet(url) {
7171
return new Promise((resolve, reject) => {
72-
https.get(url, {
73-
headers: {
74-
'User-Agent': 'rtms-build-script'
75-
}
76-
}, (res) => {
72+
const headers = {
73+
'User-Agent': 'rtms-build-script'
74+
};
75+
76+
// Use GitHub token if available (for CI/CD to avoid rate limits)
77+
if (process.env.GITHUB_TOKEN) {
78+
headers['Authorization'] = `Bearer ${process.env.GITHUB_TOKEN}`;
79+
}
80+
81+
https.get(url, { headers }, (res) => {
7782
let data = '';
7883

7984
res.on('data', (chunk) => {

0 commit comments

Comments
 (0)