fix: check merged bool in MergePullRequestFn #113
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/OpenSpec
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
RFC - Request For Comments
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
approved
area:client-host
area:item-interaction
area:meta-tooling
area:operator-dev-loop
area:repository-hygiene
area:typescript-sdk
area:website
blocked
bug
castra:bot-active
castra:human
change
checker:tobi
close-suggested
code
copilot-conflict
deferred
dependencies
docs-ok
enhancement
fast-track
groom:close-suggested
hermes-attempted
hermes-needs-clarification
hermes-ready
hermes-review
hermes-wip
human
human-required
intake
merge
merge-conflict
needs-scope
no-concept-doc
no-demo
plan-approved
plan-needs-revision
portfolio:infrastructure
portfolio:mixed
portfolio:product
portfolio:unknown
prioritize
prioritized
priority:high
priority:low
priority:medium
propose
ready
retro
retro-proposal
review
stage:backlog
stage:blocked
stage:code
stage:done
stage:intake
stage:merge
stage:propose
stage:review
stage:waiting
status:waiting
tracker
triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
agentic-forges/forgejo-mcp!113
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/113/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
MergePullRequestFndiscarded all three return values from the SDK'sMergePullRequest:The SDK returns
(bool, *Response, error)where the bool isstatusCode == 200. Any non-200 HTTP response from Forgejo — including 405 (branch protection), 409 (conflict), 403 (forbidden) — producederr == nil, causing the tool to always report "Pull request merged successfully" even when the merge didn't happen.Fix
Capture and check the bool return value. If the merge didn't return 200 and
merge_when_checks_succeedis not set, return an error with the actual HTTP status code.Discovered via
Using this tool against a repo with a branch protection rule that blocked the merge. The false positive made it impossible to diagnose why the merge wasn't landing — we only discovered the real error (
405 User not allowed to merge PR) after adding this check.