* feat: integrate GitHub OAuth device flow across runtimes Add GitHub OAuth device flow endpoints across runtimes Introduce GitHubSettings UI panel and sidebar entry Persist GitHub auth state in per-runtime storage * feat: add GitHub PR status and PR description generation Show PR status for the current branch in the Git view Generate a pull request description from the diff between base and head Expose prStatus, prCreate, and prMerge APIs in web and desktop clients * feat: add GitHub PR ready for review Add API to mark pull requests as ready for review Show a Ready button for draft PRs and reflect status in UI Handle token expiration and GraphQL errors when marking ready
11 lines
262 B
JavaScript
11 lines
262 B
JavaScript
import { Octokit } from '@octokit/rest';
|
|
import { getGitHubAuth } from './github-auth.js';
|
|
|
|
export function getOctokitOrNull() {
|
|
const auth = getGitHubAuth();
|
|
if (!auth?.accessToken) {
|
|
return null;
|
|
}
|
|
return new Octokit({ auth: auth.accessToken });
|
|
}
|