turnstyle
turnstyle copied to clipboard
Wait for queued runs and an option to refresh runs from GitHub API
Hi 👋🏽
This PR adds support to consider queued runs in addition to in_progress when checking against a list of current runs.
Problem
When a run is first created in GitHub Actions, the status will be queued before moving to in_progress
When two runs are triggered within quick succession,
there is a chance that both the runs are queued with only millisecond difference and when this action
from within the second run tries to fetch a list of in_progress runs (where id < itself), the list can be empty because the previous run hasn't still progressed to in_progress in the API results.
We have seen this behaviour multiple times in our workflows.
Change Proposed
- Fetch both
queuedandin_progressruns This would allow the second run to see that a previous run has been queued and it should wait for it to complete. - Add
initial-wait-secondsinput parameter This adds an option to fetch (again) the list of runs from the GitHub API, if no results are returned during the first poll.
Thanks
rebased: 13-Apr-2021
Any timeline on a merge? Stumbled upon it to with failure on production deployments (so very critical for us).
npm run fmtcheck and prettier --write 'src/**/*.ts' '__tests__/**/*.ts' have different behaviours
Any updates on getting this one merged?