How to set a whole workflow (instead of individual jobs) as a required status check?

I have set up a protected branch and enabled “Require status checks to pass before merging”. I have a GitHub Actions workflow that runs on every push. These runs are shown as “checks” on the pull request page.

I would like all of these to be passed before the pull request is able to be merged. To do so, I have enabled “Require status checks to pass before merging” but when I try to add the GitHub Actions workflow file that contains these jobs, I am allowed to only add individual jobs one-by-one.

This is inconvenient. If I add another job to the workflow, I will have to update the required checks as well. This is a security vulnerability. I just want to be able to set up a whole workflow as required. This way, even if I add a new job to the workflow, there is no change that I need to do on the required status checks.

So, how to do this?

I don’t think there is a “required workflow” setting. As a workaround, you can add a final job to the workflow that needs all the others (or at least those that aren’t dependencies themselves), and then mark that one as required. You’d still have to update the needs list in the workflow if you add a job, but you wouldn’t need to update the required status checks. :sweat_smile: