GitHub Actions Workflows
What happens when you trigger a GitHub Actions workflow which is already running? Workflows which depend on being run one-at-a-time might fail.
When two workflows try to push to a checked-out repo at the same time, one will fail because it is missing the last commit from the other.
A number of 3rd party solutions exist, but these introduce additional waiting costs or other issues. For one of my projects, I host a lock-service, just to force concurrent workflows to exit quietly, and then auto-trigger re-runs.
Finally, on April 19, 2021,
this appeared in the GitHub Blog.
In the case of using actions to generate a GitHub Pages website, the feature works exactly as required.
- The first workflow will run to completion.
- Subsequent concurrent workflows will either be delayed or cancelled.
- In the end only the first and last of the overlapping workflows will be run.
group can be any string - workflows in the same group are effectively serialized.
Thank you GitHub!