Restart workflow instead of starting a new workflow on new event.

Hi GitHub!

I have a workflow with one job and a series of steps. This workflow is fired on multiple different events. Each time a new event comes the workflow is fired again and I see a new Github check running and a success/failure status after it finished running.

I do not want this workflow to be run multiple times but just to restart the currently running workflow or the last finished workflow. (an “override” behaviour).

Is this possible?

Thanks all!

1 Like

Hi @andresinaka , 

I am afraid that I may have to say it is not possible. 

In Github Actions, workflows are triggered by events . You could follow this document to figure out the process for triggering a workflow run.  

An event occurs on your repository, and the resulting event webhook has an associated commit SHA and Git ref.

The workflow runs on your repository’s code at the same commit SHA and Git ref that triggered the event. So a new workflow run is on a new event. 

There is an re-run option for failed jobs. You could use it to run the failed workflow run agian . 

1 Like