Clean Up a Merged Branch
A 3-step recipe with GitLab. We can help you get access.
Recipe · 3 steps
Clean Up a Merged Branch
with GitLab · Software Construction Management
Works with AI assistants
Delete a branch only after confirming it has been merged.
- Read the branch and capture whether it has been merged.
- Unprotect the branch so it can be deleted.
- Delete the now-unprotected, merged branch.
What you'll need to have ready
- privateToken: GitLab Private-Token used to authenticate the API calls.
- projectId: The ID or URL-encoded path of the project.
- branch: The branch name to clean up.
For your developer
Arazzo workflow gitlab:cleanup-merged-branch, 3 operations: getApiV4ProjectsIdRepositoryBranchesBranch → putApiV4ProjectsIdRepositoryBranchesBranchUnprotect → deleteApiV4ProjectsIdRepositoryBranchesBranch. Specs on APIs.io.