Skip to content

feat: add delete_branch tool to repos toolset - #3

Merged
wuqunfei merged 8 commits into
mainfrom
feature/delete-branch-tool
Aug 7, 2026
Merged

feat: add delete_branch tool to repos toolset#3
wuqunfei merged 8 commits into
mainfrom
feature/delete-branch-tool

Conversation

@wuqunfei

@wuqunfei wuqunfei commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add delete_branch write tool to the repos toolset, wrapping octokit's git.deleteRef to delete a branch by name (mirrors the existing create_branch tool's conventions).
  • On success returns a synthetic { deleted: true } result, matching the delete_gist pattern, since the underlying API returns 204 No Content.
  • Bump tool count 105 → 106 and version 0.1.5 → 0.1.6 across README.md, package.json, and manifest.json.

Test plan

  • Added unit tests to test/unit/toolsets/repos.test.ts: happy path (204 → {deleted: true}), 404 error propagation, and read-only/read-write permission gating.
  • npm test — 228/228 unit tests pass.
  • npm run typecheck — clean.
  • npm run lint — clean.
  • Integration round-trip against the real GitHub API deferred — deleting a branch requires push access to a real repo, and this repo has no create_repo/delete_repo tools yet to provision a disposable one safely.

wu.qunfei@gmail.com and others added 8 commits August 6, 2026 19:39
Wraps octokit's git.deleteRef to delete a branch by name, mirroring the
create_branch tool's conventions. Returns a synthetic deleted:true result
since the API responds with 204 No Content.
Prevents false positives like Ffeature/Fmissing from URL-encoded
branch refs (%2F) in test fixtures.
Transitive esbuild versions from tsup/tsx/vite resolved to 0.27.7,
which is within the vulnerable range for GHSA-g7r4-m6w7-qqqr
(arbitrary file read via dev server on Windows). npm audit fix
couldn't bump it automatically since each parent's semver range
caps below 0.28.1, so an override was needed.
@wuqunfei wuqunfei self-assigned this Aug 7, 2026
@wuqunfei wuqunfei closed this Aug 7, 2026
@wuqunfei wuqunfei reopened this Aug 7, 2026
@wuqunfei
wuqunfei merged commit 4d1d1f3 into main Aug 7, 2026
1 check passed
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.

1 participant