Skip to content

Fix JetBrains GitHub token resolution - #1224

Merged
brunoborges merged 1 commit into
actions:mainfrom
jdubois:jdubois-fix-jetbrains-token-input
Aug 6, 2026
Merged

Fix JetBrains GitHub token resolution#1224
brunoborges merged 1 commit into
actions:mainfrom
jdubois:jdubois-fix-jetbrains-token-input

Conversation

@jdubois

@jdubois jdubois commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description:
Resolve GitHub authentication for JetBrains Runtime release discovery from the action token input first, with GITHUB_TOKEN retained as a fallback. Releases API pagination now keeps the same authentication and requests GitHub JSON media; requests remain unauthenticated when neither token source is set.

The shared token resolver is also used by the existing GitHub-hosted manifest headers. Generated dist bundles are included.

Related issue:
Fixes #1221

Check list:

  • Ran npm run check locally (format, lint, build, test) and all checks pass.
  • Documentation changes are not required.
  • Tests were added or updated to cover the changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jdubois
jdubois requested a review from a team as a code owner August 6, 2026 08:13
Copilot AI lite review requested due to automatic review settings August 6, 2026 08:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes GitHub authentication for JetBrains Runtime release discovery by resolving credentials from the action token input first (with GITHUB_TOKEN as a fallback), and ensuring the same authentication headers are used consistently across paginated GitHub Releases API requests while negotiating JSON responses.

Changes:

  • Introduces a shared getGitHubToken() utility to centralize token resolution (token input → GITHUB_TOKEN fallback).
  • Updates JetBrains Runtime release discovery to use the shared resolver, preserve auth across pagination, and request GitHub JSON media.
  • Adds/updates unit tests covering token precedence, fallback behavior, and omission of auth when no token is available (and includes regenerated dist bundles).
Show a summary per file
File Description
src/util.ts Adds shared getGitHubToken() and reuses it in GitHub header construction.
src/distributions/jetbrains/installer.ts Uses shared token resolver and JSON Accept header for paginated GitHub Releases API calls.
tests/distributors/jetbrains-installer.test.ts Adds coverage for token input precedence, env fallback, and unauthenticated behavior across pagination.
dist/setup/index.js Regenerated bundle reflecting the shared token resolver usage.
dist/setup/282.index.js Regenerated JetBrains-related bundle reflecting token/header changes.
dist/cleanup/index.js Regenerated bundle reflecting the shared token resolver export/use.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/6 changed files
  • Comments generated: 0
  • Review effort level: Lite

@brunoborges brunoborges added the maintenance Internal refactors/chore work label Aug 6, 2026
@brunoborges
brunoborges merged commit 143564d into actions:main Aug 6, 2026
84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Internal refactors/chore work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JetBrains Runtime release requests ignore the token input

3 participants