Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

add ability to commit to an existing branch using "update-repo" lib #554

@vmizg

Description

@vmizg

Firstly, thank you all contributors for this library. This is an incredible tool for polyrepo support :)

Is your feature request related to a problem? Please describe.

The "updateRepo" function provides a way to create a new branch in a repo and update it, but does not let you use an existing branch.

Describe the solution you'd like

I would like to be able to use the same tool to re-create a branch with the same name, with the use of a flag and the "deleteBranch" function for the existing branch, while the default behaviour is preserved. It could look something like this:

await updateRepo({
    updateCallback: updateCallback,
    branch: branch,
    deleteBranchIfExists: true, <---
    message: 'chore: update README',
    comment: 'chore: update README',
    reviewers: [],
});

Describe alternatives you've considered

Using "updateFileInBranch", but it is limited to a single file only.

Additional context

Notably, trying to update an existing branch with the HEAD of the last commit of the default branch will not always work out due to potential conflicts. Therefore my suggestion is to delete the specified branch and recreate it before proceeding, rather than adding commits on top.

I am happy to implement this and raise a PR should this be considered an acceptable use case.

TIA!

Metadata

Metadata

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions