First commit pushed triggers 2 workflow runs #50356
Replies: 12 comments 5 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
-
wanted to weigh in that we at kubefirst.io have also found this to be the case with our platforms that install to github. with high frequency, we create initial empty github repositories, and then push an initial commit to those repositories with repo content that includes github actions workflows designed to trigger from main. the initial push of the repo always fires 2 identical github actions pipelines off of the single commit sha pushed. for our particular workflow, one will pass and one will fail due to the git commit sha being a part of our immutable container naming convention. agree this should be a github issue. |
Beta Was this translation helpful? Give feedback.
-
@martinwoodward has confirmed this issue and a fix should be coming down the pipe soon |
Beta Was this translation helpful? Give feedback.
-
same here.I add a workflow to my laravel project and then push to my repository first time,then the workflow trigger twice.But in the next commit the workflow trigger once.Can someone explain me that this is a bug from github itself or something? |
Beta Was this translation helpful? Give feedback.
-
This is still an issue as of today There is a ticket: |
Beta Was this translation helpful? Give feedback.
-
Here's my work-around, for whatever it is worth: Background:
When that 2nd commit triggers two workflow runs instead of one, it is catastrophic for my use case. Work-around for this nasty bug:
Work-around attempts that did not work reliably:
If anyone is interested in my functional work-around, in poorly written golang code, I could post it... not sure how helpful it would be... |
Beta Was this translation helpful? Give feedback.
-
Also having this issue! Using a template repository, which contains a workflow to initialize Terraform. Upon cloning the template, the initial commit triggers two simultaneous runs of the workflow, resulting in a lock error. |
Beta Was this translation helpful? Give feedback.
-
This is an issue for us but is not catastrophic as it may be with others. But it is marginally annoying. I'll try @bowtie-ltsa's suggestion of pushing a benign workflow first. |
Beta Was this translation helpful? Give feedback.
-
FYI you can work around this by adding a concurrency interrupt to your first workflow job. jobs:
my-job:
concurrency:
group: ${{ github.head_ref }}-init
cancel-in-progress: true
runs-on: ubuntu-latest
steps: This will interrupt the first execution before it even starts. |
Beta Was this translation helpful? Give feedback.
-
Engineering advised that a fix has been shipped. |
Beta Was this translation helpful? Give feedback.
-
@johnstonmatt Hi Matt)) do you have any updates regarding the ticket you've created? We face the same issue with triggering pipelines twice |
Beta Was this translation helpful? Give feedback.
-
I'm seeing my CI actions run on twice every single push to the repo with just the default config. It's almost as annoying as Dependabot being automatically enabled without my consent.
|
Beta Was this translation helpful? Give feedback.
-
Bug
Body
The first commit to a GitHub repository with a on: push: event workflow results in that action being executed twice. The action running twice per one commit is shown plainly in the Actions view. In our particular use case this represents deploying two clusters to the cloud with Terraform, so the issue has potential to be high-impact and costly for users.
Reproduction Steps
I've made a demo repo: https://github.com/polyseam/dupe-bug-demo
Beta Was this translation helpful? Give feedback.
All reactions