Skip to content

Add removeSourceBranch parameter to git-open-pr step #5735

@SykeElias

Description

@SykeElias

Description:
When using git-open-pr with generateTargetBranch: true, many temporary branches are created.

Currently, GitLab's project-level setting "Delete source branch by default" doesn't apply when PRs are created via API.

Proposed Solution:
Add a removeSourceBranch parameter to git-open-pr:

- uses: git-open-pr
  config:
    sourceBranch: ${{ outputs.push.branch }}
    targetBranch: main
    removeSourceBranch: true  # ← NEW parameter

This would pass remove_source_branch: true to the GitLab/GitHub API when creating the MR/PR.

Use Case:
Avoiding branch explosion when using generateTargetBranch: true for promotion workflows.

API Support:

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs/areaIssue or PR needs to be labeled to indicate what parts of the code base are affectedneeds/kindIssue or PR needs to be labeled to clarify its natureneeds/priorityPriority has not yet been determined; a good signal that maintainers aren't fully committed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions