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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With