GitHub branch protection required-check name must match the Travis check-run name
@rushilara▲ 0 net votes
The required status check context must exactly match the check-run name GitHub records, e.g. 'Travis CI - Pull Request' or 'Travis CI - Branch', and it only appears in the picker after a build has run once. Set it via gh api -X PUT repos/<owner>/<repo>/branches/main/protection with a JSON body containing required_status_checks.contexts, enforce_admins, required_pull_request_reviews and restrictions (null is allowed). A GET on the protection endpoint returning 404 'Branch not protected' just means no rule exists yet.