Currently, if an existing branch exists, then it will end the run
| Error: The branch name v0.0.2 is already used.
[Run/build] โ Failure - Main Create new branch
[Run/build] exitcode '1': failure
[Run/build] โ Failure - Main ddymko/create-other-repo-branch-action@updates3
[Run/build] exitcode '1': failure
It would be nice if we could add in a new input parameter that would allow a graceful exit so that our flow could continue.
The solution I am currently testing is as follows:
if ${{ inputs.ignore_branch_exists }} && [ ! -z $(git branch --remotes --list 'origin/${{ inputs.new_branch_name }}') ]; then
echo "[INFO] Branch ${{ inputs.new_branch_ref }} already exists. Skipping branch creation"
exit 0
fi
The other option is to augment the existing branch check. I am happy to submit a PR with what I have if you are open to the suggestion!