-
Notifications
You must be signed in to change notification settings - Fork 321
add_labels.cjs only fetches first page of labels (pagination bug) #23914
Copy link
Copy link
Closed
Labels
Description
Summary
add_labels.cjs (used in the Process Safe Outputs job) fails to find labels that exist in the target repository because it only fetches the first page (≤100) of labels from the REST API.
Observed behavior
When a repository has more than 100 labels, the script logs:
Could not find label IDs for: done-by-agentic-workflow, done-by-claude-code, automation, qa
These labels may not exist in the repository. Available labels: bug, docs, duplicate, ...
The "Available labels" list ends at exactly 100 entries — the page 1 limit of GET /repos/{owner}/{repo}/labels. Labels that exist beyond page 1 are silently skipped and treated as non-existent.
Root cause
The label ID lookup fetches /repos/{owner}/{repo}/labels without paginating through all pages, so only the first 100 labels are considered.
Suggested fix
Either:
- Paginate through all pages before building the label name→ID map, or
- Look up each label individually via
GET /repos/{owner}/{repo}/labels/{name}instead of listing all labels upfront
🤖 Reported with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.