Conversation
… warning Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f1268047-60d8-4f92-a744-5bc51a32a05d Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@salmanmkc feels like this should be fixed upstream |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🚀 Smoke OpenCode MISSION COMPLETE! OpenCode delivered. 🔥 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
|
Agent Container Tool Check
Result: 12/12 tools available ✅ Overall Status: PASS
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
|
|
Commit pushed:
|
|
Ug! Smoke agent return! Me test tools. All fire. Me happy. Code strong like mammoth! 🦣✅
|
|
Smoke test run 25250269502 done! PR: fix: suppress GitHub REST API deprecation warnings by adding X-GitHub-Api-Version header
Overall: PASS ✅
|
There was a problem hiding this comment.
Me caveman. Me review code. Header fix look good. No deprecation warning. Two centralized fix cover all traffic. Me approve. LGTM! 🦴
📰 BREAKING: Report filed by Smoke Copilot · ● 1.5M
| // "@octokit/request: endpoint is deprecated" warning that fires when the | ||
| // unversioned GitHub REST API is used. | ||
| githubModule.hook.before("request", options => { | ||
| if (!options.headers["X-GitHub-Api-Version"]) { |
There was a problem hiding this comment.
Me see header check. Good guard! No overwrite caller header. Smart caveman move. 🦴
| global.getOctokit = (token, options = {}) => | ||
| getOctokitFn(token, { | ||
| ...options, | ||
| headers: { |
There was a problem hiding this comment.
Me like wrap! All token clients get header too. No miss. Centralized fix good. 🪨
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal! This PR cleanly suppresses REST API deprecation warnings by centralizing the X-GitHub-Api-Version header injection.
💥 [THE END] — Illustrated by Smoke Claude · ● 294.8K
| global.core = coreModule; | ||
| // Inject X-GitHub-Api-Version header on every request to suppress the | ||
| // "@octokit/request: endpoint is deprecated" warning that fires when the | ||
| // unversioned GitHub REST API is used. |
There was a problem hiding this comment.
✅ Good approach using hook.before to centrally inject the X-GitHub-Api-Version header. This ensures all requests through the global github object are covered without modifying individual call sites.
| // per-handler authenticated clients (cross-repo PAT operations, etc.). | ||
| global.getOctokit = (token, options = {}) => | ||
| getOctokitFn(token, { | ||
| ...options, |
There was a problem hiding this comment.
Consider extracting "2022-11-28" as a named constant (e.g. GITHUB_API_VERSION) so both call sites stay in sync if the version ever needs updating.
|
Codex smoke: FAIL Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "ab.chatgpt.com"
- "chatgpt.com"See Network Configuration for more information.
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR suppresses @octokit/request GitHub REST API deprecation warnings by ensuring requests include the required X-GitHub-Api-Version header.
Changes:
- Adds a global Octokit request hook to inject
X-GitHub-Api-Version: 2022-11-28. - Wraps
global.getOctokitso per-handler Octokit clients also include the API version header (while allowing caller headers to override). - Adds a patch changeset documenting the behavior change.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/setup_globals.cjs | Injects REST API version header for global and per-token Octokit clients to suppress deprecation warnings. |
| .changeset/patch-github-api-version-header.md | Documents the patch release and the warning suppression behavior change. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 3
| // "@octokit/request: endpoint is deprecated" warning that fires when the | ||
| // unversioned GitHub REST API is used. | ||
| githubModule.hook.before("request", options => { | ||
| if (!options.headers["X-GitHub-Api-Version"]) { |
| headers: { | ||
| "X-GitHub-Api-Version": "2022-11-28", | ||
| ...(options.headers || {}), |
| headers: { | ||
| "X-GitHub-Api-Version": "2022-11-28", | ||
| ...(options.headers || {}), | ||
| }, |
@octokit/requestemits deprecation warnings for all unversioned GitHub REST API calls — everyPOST/PATCHtoapi.github.comwas logging noise like:Changes
setup_globals.cjs: Two centralized fixes that cover all GitHub API traffic from safe-output handlers without touching individual call sites:githubModule.hook.before("request", ...)to injectX-GitHub-Api-Version: 2022-11-28on every request through the globalgithubobjectgetOctokitFnso per-handler clients created viaglobal.getOctokit(token)(used inhandler_auth,create_issue,assign_to_agent,create_pull_request) inherit the header automatically; caller-supplied headers take precedenceChangeset
Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
ab.chatgpt.comchatgpt.comSee Network Configuration for more information.