turnstyle icon indicating copy to clipboard operation
turnstyle copied to clipboard

Wait for queued runs and an option to refresh runs from GitHub API

Open vigneshmsft opened this issue 4 years ago • 3 comments

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

  1. Fetch both queued and in_progress runs This would allow the second run to see that a previous run has been queued and it should wait for it to complete.
  2. Add initial-wait-seconds input 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

vigneshmsft avatar Dec 14 '20 21:12 vigneshmsft

Any timeline on a merge? Stumbled upon it to with failure on production deployments (so very critical for us).

AmirAvram avatar Feb 22 '21 08:02 AmirAvram

npm run fmtcheck and prettier --write 'src/**/*.ts' '__tests__/**/*.ts' have different behaviours

vigneshmsft avatar Apr 13 '21 10:04 vigneshmsft

Any updates on getting this one merged?

GideonShils avatar Sep 08 '21 20:09 GideonShils