How to set Github Actions as Required Status Checks

Viewed 1717

I would like to set my GitHub Actions as required status checks so that I would be able to have protected branches and prevent commits from being pushed to specific branches if they don’t pass the github actions checks. But when I go to the branch protection rules, the github actions don’t appear in the list of checks to choose from: Repository Branch Protection Rules Do Not Show GitHub Actions

As you can see here I do have two github actions that have been running for several weeks on my repo:

GitHub Actions That Exist in the Repository

So am I missing something? How do I set Github Actions as required status checks?

1 Answers

You can still find your status check at search by name of the GitHub action job.

name: .NET

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:

    etc...

Here is name of the job is build.

Search example

Related