Skip to content

Fix issues API call to use repo-scoped endpoint#396

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-usage-workflow-issues-api
Draft

Fix issues API call to use repo-scoped endpoint#396
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-usage-workflow-issues-api

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 17, 2026

octokit.rest.issues.list() maps to GET /issues, a user-scoped endpoint that fails with a 404 when using a repo-scoped GITHUB_TOKEN. The fix switches to the correct repo-scoped endpoint.

Changes

  • src/index.ts: Replace issues.list() with issues.listForRepo() (GET /repos/{owner}/{repo}/issues)
  • dist/index.js: Rebuilt bundle reflecting the source change
- const { data: issues } = await octokit.rest.issues.list(context.repo);
+ const { data: issues } = await octokit.rest.issues.listForRepo(context.repo);

The usage.yaml workflow already declares permissions: issues: read, so no workflow changes are needed.

Original prompt

The "Usage" workflow is failing with: HttpError: Not Found when calling the issues API at src/index.ts:8:1. The action tries to list issues assigned to the authenticated user but gets a 404. This is likely because the GITHUB_TOKEN doesn't have issues: read permission or the API call is wrong for a repo-scoped token (should use GET /repos/{owner}/{repo}/issues instead of GET /issues). Please fix the permissions in the workflow YAML and/or fix the API call in src/index.ts so it works with the default GITHUB_TOKEN scope.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…B_TOKEN

Co-authored-by: austenstone <22425467+austenstone@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix usage workflow failing with 404 on issues API Fix issues API call to use repo-scoped endpoint Mar 17, 2026
Copilot AI requested a review from austenstone March 17, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants