Add GitHub API client with OAuth token support#52
Draft
Conversation
- Add fetch-github-api.js with OAuth token support - Add shell wrapper and demo script - Add comprehensive test suite - Update documentation in README.md - Add GITHUB_API_README.md with detailed usage Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
- Add OAUTH_TOKEN_EXAMPLE.md with detailed explanation - Add oauth-token-response-example.json with response format - Document token types, scopes, and security practices Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add access token response handling
Add GitHub API client with OAuth token support
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements GitHub API integration supporting OAuth access tokens and Personal Access Tokens with Bearer authentication, following the existing CDP API pattern.
Implementation
Core Client (
fetch-github-api.js)gho_*) and PAT support (ghp_*,ghs_*,ghu_*,ghr_*)Tooling
fetch-github-api.sh)demo-github-api.sh)test-github-api.js)Documentation
GITHUB_API_README.md)OAUTH_TOKEN_EXAMPLE.md)oauth-token-response-example.json)OAuth Token Format
Handles the standard GitHub OAuth response:
{ "access_token": "gho_16C7e42F292c6912E7710c838347Ae178B4a", "token_type": "bearer", "scope": "repo,gist" }Usage
Or via CLI arguments:
Files Added
contrib/devtools/fetch-github-api.js(256 lines)contrib/devtools/fetch-github-api.sh(51 lines)contrib/devtools/demo-github-api.sh(98 lines)contrib/devtools/test-github-api.js(203 lines)contrib/devtools/GITHUB_API_README.md(271 lines)contrib/devtools/OAUTH_TOKEN_EXAMPLE.md(95 lines)contrib/devtools/oauth-token-response-example.jsonWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh gh pr view --json title,body(http block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.