runner: "Re-run all jobs" button does not generate worklow_run.requested event.

Describe the bug When someone clicks the “re-run all jobs” button on a github action workflow, the workflow_run.requested event is not triggered.

This is an issue for us because we have created a custom github app that will cancel workflow_runs if the last person to edit the workflow file is not an admin on the repo. We are doing this because github has not provided a solution for our security concern outlined in the following issues:

https://github.com/actions/runner/issues/458 https://github.com/actions/runner/issues/494

My solution works great, except that when a workflow is cancelled any user can go re-run the cancelled workflow and we are not able to intercept that run and cancel it because the “re-run all jobs” button does not seem to trigger any events.

To Reproduce Steps to reproduce the behavior:

  1. Subscribe to workflow_run events.
  2. Run a workflow and you will see workflow_run:requested and then workflow_run:complete events.
  3. Now click the “Re-run all jobs” button
  4. You will see no events triggered.

Expected behavior I would expect the “re-run all jobs” button to trigger the workflow_run:requested event:action since it is actually doing that. Or at least another comparable event:action should be triggered.

Runner Version and Platform

  • Github hosted runners is where this has been tested. It looks like it does the same on all though.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15

Most upvoted comments

All,

I used to have a ‘Re-run all jobs’ button in my GitHub runner, but it seems to have disappeared. I would appreciate any help in finding out how to get this button back.

Awesome! Thank you for sharing.

@eladchen , if you trigger off of the check_run:created event:action you can get check_run.check_suite.id and then list workflow_runs for your repository using this (https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-workflow-runs-for-a-repository) and then filter the list of workflows down to the one where the "check_suite_id" matches what you pulled from the check_run:created payload. Hope that helps you workaround this.

@eladchen , I think it’s internal. I also opened an enterprise support ticket and they responded and said it was not currently supported, which wasn’t very helpful. I’m working on some code that will use the check_run:created event:action to find the related workflow_run id. If I can figure out a reliable way to reconcile the two then I’ll share it with you.