Repository navigation
Description
Summary
require-error-code-for-github-api-throw is supposed to flag throw new Error(...) statements that follow a GitHub API call in the same function when the message doesn't reference a standardized error code. Its isGitHubApiCall() helper only recognizes two call shapes:
function isGitHubApiCall(node: TSESTree.CallExpression): boolean {
if (node.callee.type !== AST_NODE_TYPES.MemberExpression) return false;
const propertyName = getStaticPropertyName(node.callee);
if (!propertyName) return false;
if (propertyName === "graphql" || propertyName === "paginate") return objectLooksLikeGitHubClient(node.callee.object);
return memberChainHasProperty(node.callee, "rest");
}(eslint-factory/src/rules/require-error-code-for-github-api-throw.ts:44-50)
This matches .graphql(...), .paginate(...), and any call whose member chain contains a .rest. segment (e.g. github.rest.issues.create(...)). It does not match Octokit's low-level escape hatch, client.request("METHOD /path", params) — for that shape propertyName is "request", which fails every branch, so isGitHubApiCall returns false and the call is never registered in githubApiCallsByFunction. Any subsequent uncoded throw new Error(...) in the same function is therefore silently ignored by this rule.
Why this matters
.request() is a common, intentional idiom in this codebase (used when there's no typed .rest.* helper for an endpoint, or for endpoints Octokit doesn't wrap). It is not a rare edge case:
~28 live .request(...) call sites across 14+ files in actions/setup/js (grep for github.request(|octokit.request(, non-test files)
update_project.cjsadd_reaction.cjscreate_project.cjsclose_issue.cjsadd_workflow_run_comment.cjsadd_reaction_and_edit_comment.cjsnotify_comment_error.cjscreate_issue.cjs- (plus several more files using the same idiom without importing
error_codes.cjs, which are out of this rule's scope entirely per its own precondition)
Of those, update_project.cjs, add_reaction.cjs, create_project.cjs, close_issue.cjs, add_workflow_run_comment.cjs, add_reaction_and_edit_comment.cjs, notify_comment_error.cjs, and create_issue.cjs all require("./error_codes.cjs"), i.e. they satisfy the rule's own enabling precondition (hasErrorCodesRequire) — so this rule is supposed to be active in exactly these files, but silently can't see any of the .request() call sites in them.
Current impact vs. latent risk
Manually auditing the throw sites that follow .request() calls in those 8 files today, every one of them already includes a standardized error code by convention, and the broader sibling rule require-error-code-in-thrown-error (which fires on any uncoded throw new Error(...) in an error_codes.cjs-importing file, with no GitHub-API-call precondition) currently provides a safety net for the same throw sites. So there is no live missed diagnostic today.
However, this is incidental, not structural:
- The rule's own name and docs ("require throw new Error(...) after GitHub API calls ... to include a standardized error code") promise coverage of GitHub API calls generically. A
.request()call is unambiguously a GitHub API call, and a maintainer reading this rule's description would reasonably assume it's covered. - If the sibling
require-error-code-in-thrown-errorrule is ever narrowed, disabled, or diverges (e.g. a new file adopts the.request()idiom without yet importingerror_codes.cjsin the exact wayhasErrorCodesRequireexpects), this rule provides zero protection for the.request()idiom specifically. - The rule's own per-function correlation logic (
getFunctionsForGitHubApiCall/githubApiCallsByFunction) is more precise than the blanket sibling rule (same-function, call-precedes-throw ordering, retry-wrapper correlation) — that precision is completely defeated for.request()call sites since they're never registered in the first place.
Suggested fix
Extend isGitHubApiCall to also recognize the .request(...) escape hatch when the receiver looks like a GitHub client, mirroring the existing objectLooksLikeGitHubClient check already used for .graphql/.paginate:
if (propertyName === "graphql" || propertyName === "paginate" || propertyName === "request") {
return objectLooksLikeGitHubClient(node.callee.object);
}Acceptance criteria
-
isGitHubApiCallrecognizesgithub.request(...)/octokit.request(...)(and otherobjectLooksLikeGitHubClient-qualifying receivers) as a GitHub API call, consistent with how.graphql/.paginateare already handled. - Add a rule test fixture: a function that calls
github.request("POST /repos/{owner}/{repo}/issues", {...})followed by an uncodedthrow new Error("failed")in the same function — must be flagged. - Add a valid-case test fixture: the same shape but with a coded message (e.g.
throw new Error(\ERR_API: failed`)`) — must not be flagged. - Re-verify the 8 grounded live files (
update_project.cjs,add_reaction.cjs,create_project.cjs,close_issue.cjs,add_workflow_run_comment.cjs,add_reaction_and_edit_comment.cjs,notify_comment_error.cjs,create_issue.cjs) still show 0 live diagnostics after the fix (their.request()throw sites already carry error codes by convention) — confirms no regression, only closes the coverage gap for future code.
Scope note
This was found via static AST-logic tracing plus corpus grounding (no live lint run possible in this sandbox — eslint-factory has no node_modules/npm access). Filed per the ESLint Refiner workflow's eslint-factory review scope.
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
api.anthropic.com
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
Generated by 🤖 ESLint Refiner · claude · agent · 350.7 AIC · ⌖ 8.51 AIC · ⊞ 5.8K · ◷
- expires on Sep 12, 2026, 9:35 PM UTC-08:00
Activity
github-actions commentedon Sep 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 6, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
65 remaining items
github-actions commentedon Sep 8, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I’ve identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 9, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ab.chatgpt.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
github-actions commentedon Sep 13, 2026
This issue was automatically closed because it expired on 2026-09-13T05:35:13.610Z.