fix: bug: dev-agent does not clean up branch/worktree on CI exhausted or block (#115)
This commit is contained in:
parent
0f6f074b6d
commit
e9a4fc7b80
2 changed files with 23 additions and 0 deletions
|
|
@ -348,6 +348,22 @@ pr_is_merged() {
|
|||
[ "$merged" = "true" ]
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# pr_close — Close a PR via forge API.
|
||||
# Args: pr_number
|
||||
# Returns: 0=closed, 1=error
|
||||
# ---------------------------------------------------------------------------
|
||||
pr_close() {
|
||||
local pr_num="$1"
|
||||
|
||||
_prl_log "closing PR #${pr_num}"
|
||||
curl -sf -X PATCH \
|
||||
-H "Authorization: token ${FORGE_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${FORGE_API}/pulls/${pr_num}" \
|
||||
-d '{"state":"closed"}' >/dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# pr_walk_to_merge — Walk a PR through CI, review, and merge.
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue