Codeberg icon

Codeberg

Interact with the Codeberg API

Pull Request → Merge

AI-generated

Summary

Merge a specific pull request in a Codeberg repository using one of three merge methods (merge, rebase, squash).

Inputs

  • Owner (required) — The owner of the repository where the pull request exists.
  • Repository Name (required) — The name of the repository where the pull request exists.
  • Pull Request Number (required) — The number identifying the pull request to merge.
  • Merge Method (required) — The method to use for merging: merge, rebase, or squash.
  • Additional Fields — Optional settings including: Delete Branch After Merge (boolean to delete the source branch after a successful merge), Merge Commit Message (custom commit message), and Merge Title (custom merge title).

Output shape

A single JSON object describing the result of the merge operation.

The response may include details of the merge result; if not, a success confirmation is returned. If the merge fails, an error is thrown.

Examples

Example 1: Merge a pull request with squash method and delete the source branch

Set owner, repo, pull request number; choose 'Squash' as merge method; enable delete_branch_after_merge to true.

Links

Discussion