auto-close-duplicates and backfill-duplicate-comments scripts exit 0 when they fail

Open Beginner friendly
#113,984 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, github-actions, typescript
Domain
ci-cd, tooling

Research direction

Read scripts/auto-close-duplicates.ts and scripts/backfill-duplicate-comments.ts and inspect how each script handles rejected promises at its entry point. Run the reproduction command from the issue with GITHUB_TOKEN unset to confirm the current exit code. Done when both scripts exit non-zero on failure and the reproduction no longer reports exit 0.

Written by the indexing model from the issue text.

Description

area:tools bug has repro

What's wrong

scripts/auto-close-duplicates.ts and scripts/backfill-duplicate-comments.ts end with:

autoCloseDuplicates().catch(console.error);

.catch(console.error) logs the error and then lets the process exit with code 0. When either script fails (missing or invalid GITHUB_TOKEN, a rate limit, or any GitHub API error from githubRequest), the step still passes. The scheduled "Auto-close duplicate issues" workflow shows green even though no duplicates were closed.

Steps to reproduce

env -u GITHUB_TOKEN bun run scripts/auto-close-duplicates.ts; echo "exit: $?"

It prints Error: GITHUB_TOKEN environment variable is required and then exit: 0.

What should happen

The scripts should exit non-zero when they throw, so the workflow run fails and the failure is visible.

Dominant language
TypeScript
Stars
158k
Forks
25.1k
Avg merge
1d 8h
Merged PRs (30d)
4

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anthropics/claude-code

All issues in anthropics/claude-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.