DEV Community

Discussion on: The Magic of Empty Git Commit

Collapse
 
cavo789 profile image
Christophe Avonture

I'm using it when I wish to rerun my CI jobs.

I'm using a repo with template so when I change that repo (the one with templates), then I should rerun my CI and empty commits are really useful then..

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Likewise

Collapse
 
remejuan profile image
Reme Le Hane

which CI do you use, I currently have workflows on GitHub, GCP and Azure, previous company was AWS and they all have buttons to run the pipeline?

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

I work with GitHub Actions, but on projects with hundreds of maintainers, you don't have direct access to CI or third-party buttons/mutual triggers. Bots are used to merge the PRs and ask for an empty commit to be pushed because that is the only way to rerun the CI.

If you see projects like Kubernetes, Flutter, etc., they also follow the same pattern.

Thread Thread
 
rahulpatidar0191 profile image
Rahul

Thanks for the nice article. I certainly have been there where I needed a job run but the only way to trigger it to make a commit that wasn't needed.

For GitHub actions, we have stared using workflow-dispatch , that lets you manually trigger a workflow

Collapse
 
cavo789 profile image
Christophe Avonture

Gitlab but the most important part is i'm using templates" : the coding of my job is located in a specific repo, not the one i'm submitting.

If (with gitlab) I rerun my CI the template is reused from a cache even if i'm update my template repo.

GitLab will take my updated template only with a new commit. This is why i'm using an empty commit.

Collapse
 
atotalnoob profile image
atotalnoob

Can't you just have the parent ci trigger the child ci.

It's a common feature for most ci vendors

Some comments have been hidden by the post's author - find out more