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

Workflow intermittently triggers the dispatch target twice #360

Closed
bbimber opened this issue Nov 27, 2024 · 2 comments
Closed

Workflow intermittently triggers the dispatch target twice #360

bbimber opened this issue Nov 27, 2024 · 2 comments

Comments

@bbimber
Copy link

bbimber commented Nov 27, 2024

Hello,

Thanks for this very useful action. Broadly speaking this is working perfectly, but some of the time, and I cannot really see a pattern, it double-triggers the action on the target repo. This is the source repo's yml file:

https://github.com/bimberlabinternal/docker-base/blob/1d83e0aca63fb5abb85999d41a39aa1461df89eb/.github/workflows/docker.yml#L59

You'll see it triggers a docker workflow on several target repos. One example is this:

https://github.com/BimberLab/cellhashR/blob/8bcfc631818f7496fe9a620d1c5165c9f40897de/.github/workflows/docker.yml#L7

Again, the vast majority of the time this works perfectly, but some of the time it results in double-triggering of the target. This is a complete guess, but could this be something like the plugin making an HTTP request to trigger the workflow, that requesting timing out or erroring, and then the plugin repeats the request?

In our case, the target is just building a docker image so the impact is not huge, but I thought I would report this. I'm happy to try some debugging if anything would help.

@peter-evans
Copy link
Owner

peter-evans commented Nov 28, 2024

Hi @bbimber

I don't think the action retries failed requests. What I think is more likely is that GitHub's internal systems are retrying the delivery of the dispatch due to transient failures. My guess would be that the system is designed to deliver with "at-least-once" semantics, so occasional double-triggers are somewhat unavoidable.

What you could do is send a unique key with the dispatch and check it in the target workflow to make sure you only execute once.

@bbimber
Copy link
Author

bbimber commented Nov 29, 2024

OK, thanks for the suggestions

@bbimber bbimber closed this as completed Nov 29, 2024
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

2 participants