Title: Possible race condition when commitizen-action is triggered twice by two different pushes · Issue #101 · commitizen-tools/commitizen-action · GitHub
Open Graph Title: Possible race condition when commitizen-action is triggered twice by two different pushes · Issue #101 · commitizen-tools/commitizen-action
X Title: Possible race condition when commitizen-action is triggered twice by two different pushes · Issue #101 · commitizen-tools/commitizen-action
Description: Background When an automatic workflow with the commitizen-action is set to run on pushes to a remote branch, whenever two separate pushes are done in short succession (less time than it takes for the workflow triggered by the earlier pus...
Open Graph Description: Background When an automatic workflow with the commitizen-action is set to run on pushes to a remote branch, whenever two separate pushes are done in short succession (less time than it takes for t...
X Description: Background When an automatic workflow with the commitizen-action is set to run on pushes to a remote branch, whenever two separate pushes are done in short succession (less time than it takes for t...
Opengraph URL: https://github.com/commitizen-tools/commitizen-action/issues/101
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Possible race condition when commitizen-action is triggered twice by two different pushes","articleBody":"### Background\n\nWhen an automatic workflow with the `commitizen-action` is set to run on pushes to a remote branch, whenever two separate pushes are done in short succession (less time than it takes for the workflow triggered by the earlier push to finish) the bumps will not complete successfully and a git tag will be pushed in a detached state.\n\n### Cause\n\nThe workflow that was triggered by the early most push will check the repository out on commit that will then be outdated after the second push happens. The `cz bump` command then gets executed on an outdated commit, the rebase triggered by the `git pull` command will move the \"bump commit\" to be the most recent commit of the branch, however since a git rebase effectively creates new commits the git tag created by `cz bump` will be left on the old outdated bump commit in a \"detached state\", at the end since the `git push ... --tags` command doesn't do any checks as regarding to the state of the pushed tags the tag will be pushed in the \"detached state\" (not part of the (or any) branch) to the remote repository.\n\nThe latter workflow will than fail, if trying to increment to the same version, to push its tags to remote as that tag is already present there (in the \"detached state\").\n\n### Possible solution\n\n- Don't rebase before pushing the bump commit and push the created tag separately, only if the commit was pushed correctly - in the case of the race condition described above the earlier workflow will fail, however the subsequent workflow runs will run correctly and no tags in the detached state will be pushed to the remote. (This is also similar to the example provided in the `commitizen` documentation for GitLab CI: https://commitizen-tools.github.io/commitizen/tutorials/gitlab_ci/#stages-and-jobs)","author":{"url":"https://github.com/michal-gomolinski","@type":"Person","name":"michal-gomolinski"},"datePublished":"2025-02-18T20:20:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/101/commitizen-action/issues/101"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a49f5af1-4c21-06ef-8104-f314e8cbcc5a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C870:300F19:8270FC2:A8BF7F5:69766AC1 |
| html-safe-nonce | 65f25e0efd0d3fe409c7c0ed86bd25a845940201596521fb9bda5b1c1e1799be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODcwOjMwMEYxOTo4MjcwRkMyOkE4QkY3RjU6Njk3NjZBQzEiLCJ2aXNpdG9yX2lkIjoiNDk0NTUwNjA0Mzk3MTM5ODMzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e704dab3382e22e315d0c26a80cd3452de0f2328e4b35b800c34c491e866257d |
| hovercard-subject-tag | issue:2861556898 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/commitizen-tools/commitizen-action/101/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d79f27a880e998ae0fdd72ebff926f1cb4fac4a768f6bc4a558c484d63188db5/commitizen-tools/commitizen-action/issues/101 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d79f27a880e998ae0fdd72ebff926f1cb4fac4a768f6bc4a558c484d63188db5/commitizen-tools/commitizen-action/issues/101 |
| og:image:alt | Background When an automatic workflow with the commitizen-action is set to run on pushes to a remote branch, whenever two separate pushes are done in short succession (less time than it takes for t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | michal-gomolinski |
| hostname | github.com |
| expected-hostname | github.com |
| None | 032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411 |
| turbo-cache-control | no-preview |
| go-import | github.com/commitizen-tools/commitizen-action git https://github.com/commitizen-tools/commitizen-action.git |
| octolytics-dimension-user_id | 62252524 |
| octolytics-dimension-user_login | commitizen-tools |
| octolytics-dimension-repository_id | 287308634 |
| octolytics-dimension-repository_nwo | commitizen-tools/commitizen-action |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 287308634 |
| octolytics-dimension-repository_network_root_nwo | commitizen-tools/commitizen-action |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5b577f6be6482e336e3c30e8daefa30144947b17 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width