A release bot must push version bump commits to protected `main`, but humans must not.
AdvancedScenarioProtection, Hooks and Policy
Answer
Situation read → The bot needs a narrow exception, not a weakening of the rule for everyone.
What I'd do →
- Use a GitHub App (not a personal token) for the bot, with minimal permissions.
- Add only that app to the ruleset bypass list.
- Prefer having the bot open a PR with auto-merge, which needs no bypass at all.
- Store the app credentials as environment secrets and rotate keys.
Why → Apps have scoped permissions and appear clearly in the audit log, unlike a shared human PAT.
Interview tip → The PR-based approach avoids bypass entirely and is the safer pattern.
More on Protection, Hooks and Policy
You are asked to protect `main`. Which rules do you turn on?BeginnerClassic branch protection or repository rulesets: which do you use?IntermediateA required status check never reports and the PR is stuck as "Expected — Waiting for status".IntermediateProduction is down and the fix needs to merge now, but approvals are required.IntermediateYou want to stop developers from committing obvious mistakes like debug prints, trailing whitespace or secrets.BeginnerHooks in `.git/hooks` are not shared with the team. How do you distribute them?Intermediate