Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the option to leverage --force in git push #395

Closed
austinsasko opened this issue Nov 17, 2022 · 4 comments
Closed

Allow the option to leverage --force in git push #395

austinsasko opened this issue Nov 17, 2022 · 4 comments

Comments

@austinsasko
Copy link

Semantic release can generate certain artifacts or files (such as changelog.md) that get added to the staged changes, prior to being committed and pushed.

There are certain use cases that might necessitate the git push being done with the --force flag. Our use case is based on being able to push CHANGELOG.md to main on releases, forcing the push would allow us to override specific requirements that may exist (such as GitHub status checks).

As such, I would propose that there be a flag that allow the git plugin to take an option for --force.

@travi
Copy link
Member

travi commented Nov 18, 2022

forcing the push would allow us to override specific requirements that may exist (such as GitHub status checks)

i'm not aware of this being related. forcing a git push is typically related to pushing when the local HEAD does not match the remote HEAD (thus clobbering the remote commits that are different from the ones being pushed). can you point to documentation about how a force push would relate to overriding requirements like status checks?

@austinsasko
Copy link
Author

I agree, I am unable to reproduce the behavior I previously saw multiple times, probably was a mistake on my side where I was not actually enforcing something and --force made me think it was the key differentiator. Thanks

@lukas-henry
Copy link

Hello, I think this will be a good feature. For example, in a monorepo when you make a release, and in that release, you have two affected apps, you want to generate two different changelogs. In my case, I generate two child pipelines and make the release independently, so the problem is that the first pipeline push, for example, apps/app1/changelog.md ok, and the second pipeline fails because the master branch was updated ... is annoying cuz I only want to update the changelog.md. Exists any possibility of adding this feature or re-open this issue?

@austinsasko
Copy link
Author

@lukas-henry The issue is that the remote will only have one of those changelogs. Your best bet is trying to pull the changes from the git remote just before making them on the release

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

No branches or pull requests

3 participants