Skip to content

Add create_branch option to force create a new branch#203

Merged
stefanzweifel merged 8 commits intomasterfrom
feature/create-branch-if-not-exists
Feb 27, 2022
Merged

Add create_branch option to force create a new branch#203
stefanzweifel merged 8 commits intomasterfrom
feature/create-branch-if-not-exists

Conversation

@stefanzweifel
Copy link
Copy Markdown
Owner

This PR is yet another attempt to solve the problem of "what should happen if the given branch does not exist yet".
As previous attempts failed and broke the action for all userrs, I've decided to add a new option called create_branch to make this basically an opt-in feature.

By default create_branch is false and using a branch-name that doesn't exist yet, fails the action with "fatal: invalid reference: not-existend-branch".

Setting create_branch to true, we use the -B-option of git-checkout to create a new branch. From there the Action works like before and pushes the commit to the remote branch.

Related Issues and PRs

@stefanzweifel stefanzweifel merged commit ebe7739 into master Feb 27, 2022
@stefanzweifel stefanzweifel deleted the feature/create-branch-if-not-exists branch February 27, 2022 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant