EndBug / pages-preview

:octocat: A GitHub Action that creates a GitHub Pages preview for PRs and branches
MIT License
15 stars 1 forks source link

Better handle concurrency in preview repo #2

Open EndBug opened 1 year ago

EndBug commented 1 year ago

As of now, the preview repo uses one concurrency group for every run. This makes it so that if multiple previews are deployed at the same time, some jobs can get cancelled: even if cancel-in-progress is set to false, pending runs will be cancelled anyway.

Since the preview has already been pushed to the repo it will be deployed anyway, but the workflow will fail since the status will be "cancelled".

Ideally, if the workflow run ends up being cancelled, we should wait for the one that has taken priority over it and wait for that to be completed.
If that's not possible, we should at least pick the current running job and try to wait for that before posting commenting.