Skip to content

Force push when creating a new branch#3

Merged
neilvcarvalho merged 2 commits into
mainfrom
nc/force-push-branch
May 15, 2026
Merged

Force push when creating a new branch#3
neilvcarvalho merged 2 commits into
mainfrom
nc/force-push-branch

Conversation

@neilvcarvalho
Copy link
Copy Markdown
Member

If a workflow run fails, the next one may fail because it can't push the new changes to the branch with the same name.

This commit passes in force: true to @git.push to ensure that the commits will be pushed to that branch.

If a workflow run fails, the next one may fail because it can't push the
new changes to the branch with the same name.

This commit passes in `force: true` to `@git.push` to ensure that the
commits will be pushed to that branch.
`--force-with-lease` is a way to protect a forced push against
overwriting commits that only exist in the remote branch.

This action always creates branches from scratch based on `main`, so it
can't use that feature. Also, there's nothing to protect from. The newly
created branches will always be current.
@neilvcarvalho neilvcarvalho merged commit ce75bf9 into main May 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant