Reputation: 1657
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:
As you can see here I do have two github actions that have been running for several weeks on my repo:
So am I missing something? How do I set Github Actions as required status checks?
Upvotes: 32
Views: 15946
Reputation: 3075
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.
Upvotes: 7
Reputation: 396
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.
Upvotes: 38