Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Github Actions as Required Status Checks

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?

like image 704
Eyal Gerber Avatar asked Sep 01 '25 16:09

Eyal Gerber


2 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

like image 51
Nikolay Kreshchuk Avatar answered Sep 04 '25 07:09

Nikolay Kreshchuk


Give a name to a Job

jobs:
  build:
    name: Code Formatting

otherwise, it gives a build as a default name

And on the setting page, it gives suggestions whenever you start searching by job name.

like image 22
Ravi Sevta Avatar answered Sep 04 '25 07:09

Ravi Sevta