Skip to content

fix: suppress GitHub REST API deprecation warnings by adding X-GitHub-Api-Version header#29743

Merged
pelikhan merged 2 commits intomainfrom
copilot/review-api-deprecation-message
May 2, 2026
Merged

fix: suppress GitHub REST API deprecation warnings by adding X-GitHub-Api-Version header#29743
pelikhan merged 2 commits intomainfrom
copilot/review-api-deprecation-message

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 2, 2026

@octokit/request emits deprecation warnings for all unversioned GitHub REST API calls — every POST/PATCH to api.github.com was logging noise like:

[@octokit/request] "POST https://api.github.com/repos/.../issues" is deprecated.
It is scheduled to be removed on Fri, 10 Mar 2028 00:00:00 GMT.

Changes

  • setup_globals.cjs: Two centralized fixes that cover all GitHub API traffic from safe-output handlers without touching individual call sites:
    • Registers a githubModule.hook.before("request", ...) to inject X-GitHub-Api-Version: 2022-11-28 on every request through the global github object
    • Wraps getOctokitFn so per-handler clients created via global.getOctokit(token) (used in handler_auth, create_issue, assign_to_agent, create_pull_request) inherit the header automatically; caller-supplied headers take precedence

Changeset

  • Type: patch
  • Description: Suppress GitHub REST API deprecation warnings by adding the required API version header to safe-output GitHub clients.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • ab.chatgpt.com
  • chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"
    - "chatgpt.com"

See Network Configuration for more information.

Generated by Changeset Generator for issue #29743 ·

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented May 2, 2026

@salmanmkc feels like this should be fixed upstream

@pelikhan pelikhan added the smoke label May 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions github-actions Bot removed the smoke label May 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

🚀 Smoke OpenCode MISSION COMPLETE! OpenCode delivered. 🔥

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

⚠️ Smoke Crush failed. Crush encountered unexpected challenges...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.53.0
jq 1.7
yq 4.52.5
curl 8.5.0
gh 2.89.0
node 22.22.2
python3 3.10.16 (PyPy)
go 1.24.13
java 10.0.201
dotnet 10.0.201

Result: 12/12 tools available ✅

Overall Status: PASS

🔧 Tool validation by Agent Container Smoke Test · ● 259.7K ·

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

⚠️ Smoke Gemini failed. Gemini encountered unexpected challenges...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

Commit pushed: cbdec3c

Generated by Changeset Generator

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

Ug! Smoke agent return! Me test tools. All fire. Me happy. Code strong like mammoth! 🦣✅

📰 BREAKING: Report filed by Smoke Copilot · ● 1.5M ·

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

Smoke test run 25250269502 done!

PR: fix: suppress GitHub REST API deprecation warnings by adding X-GitHub-Api-Version header

Test Status
GitHub MCP PRs
MCP Scripts GH
Serena CLI
Playwright
Web Fetch
File Write
Discussion
Build
Artifact
Discussion Create
Haiku Dispatch
PR Review

Overall: PASS ✅

@pelikhan @Copilot

📰 BREAKING: Report filed by Smoke Copilot · ● 1.5M ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

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"]) {
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.

Me see header check. Good guard! No overwrite caller header. Smart caveman move. 🦴

global.getOctokit = (token, options = {}) =>
getOctokitFn(token, {
...options,
headers: {
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.

Me like wrap! All token clients get header too. No miss. Centralized fix good. 🪨

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

Smoke Test Run 25250269477 — Claude engine

Test
#1 GitHub MCP
#4 Make build
#7 File write
#10 AW MCP
#13 Update PR
#16 Resolve thread ⚠️
#19 Close PR ⚠️

Overall: PARTIAL (2 skipped, 0 failed)

💥 [THE END] — Illustrated by Smoke Claude · ● 294.8K ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

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

✅ 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,
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.

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

Codex smoke: FAIL
PRs: #29735 fix: remove --ignore-scripts for crush install and add crush --version step; #29721 refactor: decompose generatePostAgentCollectionAndUpload into focused helpers
✅ GitHub MCP, Serena, Playwright, file, bash, build, comment memory, cache memory
❌ Web Fetch MCP: tool unavailable

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • ab.chatgpt.com
  • chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"
    - "chatgpt.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex ·

@pelikhan pelikhan marked this pull request as ready for review May 2, 2026 11:07
Copilot AI review requested due to automatic review settings May 2, 2026 11:07
@pelikhan pelikhan merged commit 37a92b2 into main May 2, 2026
9 of 10 checks passed
@pelikhan pelikhan deleted the copilot/review-api-deprecation-message branch May 2, 2026 11:07
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

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.getOctokit so 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"]) {
Comment on lines +52 to +54
headers: {
"X-GitHub-Api-Version": "2022-11-28",
...(options.headers || {}),
Comment on lines +52 to +55
headers: {
"X-GitHub-Api-Version": "2022-11-28",
...(options.headers || {}),
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants