Skip to content

Revert "fix(build): use Bearer auth for GitHub API requests in fetch.ts"#312032

Merged
Yoyokrazy merged 2 commits intomainfrom
revert-312022-agents/investigate-pat-issues-1es-runners
Apr 22, 2026
Merged

Revert "fix(build): use Bearer auth for GitHub API requests in fetch.ts"#312032
Yoyokrazy merged 2 commits intomainfrom
revert-312022-agents/investigate-pat-issues-1es-runners

Conversation

@Yoyokrazy
Copy link
Copy Markdown
Collaborator

Reverts #312022

Copilot AI review requested due to automatic review settings April 22, 2026 22:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a Basic header built from base64-encoding GITHUB_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

Comment thread build/lib/fetch.ts
};
if (process.env.GITHUB_TOKEN) {
ghApiHeaders.Authorization = 'Bearer ' + process.env.GITHUB_TOKEN;
ghApiHeaders.Authorization = 'Basic ' + Buffer.from(process.env.GITHUB_TOKEN).toString('base64');
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
ghApiHeaders.Authorization = 'Basic ' + Buffer.from(process.env.GITHUB_TOKEN).toString('base64');
ghApiHeaders.Authorization = `Bearer ${process.env.GITHUB_TOKEN}`;

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: d4da5f2a Current: 332978a6

Changed (3)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
editor/inlineCompletions/other/JumpToHint/Light
Before After
before after
editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after

@Yoyokrazy Yoyokrazy enabled auto-merge (squash) April 22, 2026 22:54
@Yoyokrazy Yoyokrazy merged commit cdb3b86 into main Apr 22, 2026
26 checks passed
@Yoyokrazy Yoyokrazy deleted the revert-312022-agents/investigate-pat-issues-1es-runners branch April 22, 2026 23:32
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants