Conversation
There was a problem hiding this comment.
Pull request overview
This PR reverts a previous build change that switched GitHub API authentication in build/lib/fetch.ts to use Bearer tokens, restoring the prior Basic-auth header construction.
Changes:
- Replaces
Authorization: Bearer ${GITHUB_TOKEN}with aBasicheader built from base64-encodingGITHUB_TOKEN.
Show a summary per file
| File | Description |
|---|---|
| build/lib/fetch.ts | Reverts the GitHub API Authorization header format used by build-time fetch helpers. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
| }; | ||
| if (process.env.GITHUB_TOKEN) { | ||
| ghApiHeaders.Authorization = 'Bearer ' + process.env.GITHUB_TOKEN; | ||
| ghApiHeaders.Authorization = 'Basic ' + Buffer.from(process.env.GITHUB_TOKEN).toString('base64'); |
There was a problem hiding this comment.
Authorization is being set to Basic <base64(GITHUB_TOKEN)>, but GITHUB_TOKEN is a raw token (e.g. from gh auth token / Actions) and Basic auth requires a username:password credential string. This will produce an invalid Basic header and likely cause 401s for GitHub API/release asset requests. Use Authorization: Bearer ${process.env.GITHUB_TOKEN} (or token ${...}) instead of Basic/base64 here, consistent with other build scripts (e.g. build/azure-pipelines/common/checkDistroCommit.ts uses Bearer).
| ghApiHeaders.Authorization = 'Basic ' + Buffer.from(process.env.GITHUB_TOKEN).toString('base64'); | |
| ghApiHeaders.Authorization = `Bearer ${process.env.GITHUB_TOKEN}`; |
Reverts #312022