Skip to content

Use --atomic when running git push #2495

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

Open
nayanmanojgupta opened this issue Mar 20, 2025 · 1 comment
Open

Use --atomic when running git push #2495

nayanmanojgupta opened this issue Mar 20, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@nayanmanojgupta
Copy link

nayanmanojgupta commented Mar 20, 2025

Describe the bug

Currently, "auto" uses "git push --follow-tags" which is non-atomic by default.
Using non-atomic push can cause issues. For example, if a protected branch hook is enabled, branch updates will be rejected.
In such cases, a tag might be created but the changelog will not be committed. This will result in a "tag already exists" error during the next run

To Reproduce

  1. Enable a protected branch hook, such as requiring commits to be made through a pull request.
  2. Remove admin permissions from the bot user.
  3. Execute "auto shipit".

As a result, tags will be pushed but branch changes will be rejected. These orphan tags will then have to be manually deleted to prevent future conflicts.

Expected behavior
Use "git push --follow-tags --atomic," supported since Git v2.4.0. This ensures that no orphan tags are created.

Screenshots

Image

Environment information:

Environment Information:

"auto" version: v11.2.1
"git"  version: v2.39.5 (Apple Git-154)
"node" version: v16.16.0
GHE version:    v3.12.8

Additional context:
I am aware about the protected-branch plugin, but I prefer not to create a PR for each changelog commit.
If there's an accidental change in the service account permission from admin to write, I want AUTO tool to either push all references on the remote or none at all.

@nayanmanojgupta nayanmanojgupta added the bug Something isn't working label Mar 20, 2025
nayanmanojgupta pushed a commit to nayanmanojgupta/auto that referenced this issue Mar 21, 2025
@ykhandelwal913
Copy link
Collaborator

@hipstersmoothie can you review this PR. We are facing similar issue where tags are getting created but branch push failed and next run says, tags already exist. With this, it wont push the changes if any of the push failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants