DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk8 min

GitHub branch protection rules that prevent unauthorized pushes and workflow changes

A practical guide to protecting GitHub main and release branches with pull requests, required checks, push restrictions, rulesets, Actions policies, and REST API audits.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To stop unauthorized changes, protect main and release branches with pull-request reviews, current passing checks, restricted push actors, and administrator enforcement. Turn off force pushes and branch deletion, then add rulesets and Actions policies when you also need to control workflow files, fork networks, or who may execute automation.

The key distinction is that branch protection controls what can be merged or pushed into a branch, while Actions policies control which workflow runs are allowed to start. A secure setup uses both layers and verifies the resulting policy through GitHub’s protected-branch API.

As an Amazon Associate I earn from qualifying purchases.

What a protected branch actually controls

A branch-protection rule applies to branches matching the pattern you choose, such as main, release/*, or a broader branch set. The rule can require a pull request, approvals, status checks, resolved conversations, signed commits, linear history, a merge queue, successful deployments, or a locked branch. It can also restrict push actors and prohibit force pushes or deletion.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

These controls address different risks. Reviews and checks govern the quality and authorization of a merge; push restrictions govern who can update the ref at all; force-push and deletion controls prevent destructive rewrites; signed-commit requirements help establish author authenticity; and administrator enforcement removes the normal administrative bypass.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Controls that matter most for unauthorized updates

Control What it prevents or requires
Require a pull request Changes must arrive through a reviewed pull request instead of a direct update.
Required approving reviews Sets the number of approvals needed before a merge.
Approval of the most recent reviewable push Requires a fresh approval after the latest reviewable change, preserving separation between author and approver.
Required status checks Blocks merging until selected checks report an acceptable result on the current commit.
Restrict who can push Limits direct updates to named users, teams, or installed GitHub Apps.
Do not allow bypassing the above settings Applies the rule to administrators instead of allowing the default administrative bypass.
Prevent force pushes Stops non-fast-forward updates that rewrite branch history.
Prevent deletion Stops the protected branch from being deleted.
Conversation resolution Requires review conversations to be resolved before merging.
Signed commits Requires commits in the protected history to carry a valid signature.
Linear history Requires a non-merge, linear commit history where the project’s process calls for it.
Merge queue Queues qualifying pull requests and validates them in the queue’s merge context.
Required deployments Requires specified deployments to succeed before a merge.
Branch locking Locks the branch against updates while the lock is active.

How do I prevent direct pushes to main?

  1. Open the repository and select Settings → Branches.
  2. Create a branch-protection rule for main. Add separate rules for release patterns such as release/* when those branches need the same guarantees.
  3. Enable the pull-request requirement and select the approval count. If the person who authored the latest change must not be the sole approver, enable approval of the most recent reviewable push.
  4. Enable required status checks and select the checks that represent your build, test, security, and deployment gates. Turn on the option requiring branches to be up to date when those checks must run against the latest base commit.
  5. Enable conversation resolution if unresolved review threads should block merging. Add signed-commit or linear-history requirements only if contributors and tooling can satisfy them consistently.
  6. Under push restrictions, specify the users, teams, or installed GitHub Apps that may update the protected branch. Keep this list as small as the operating model allows.
  7. Disable force pushes and branch deletion. These settings protect the branch even when a caller has ordinary write access.
  8. Enable Do not allow bypassing the above settings when administrators must be subject to the same gates.
  9. Save the rule, then test it with an account that is not an administrator or bypass actor. Confirm that a direct push is rejected and that a pull request cannot merge until each selected condition is satisfied.

Branch restrictions are an allow-list, not merely a warning. GitHub describes the effect this way: "When you enable branch restrictions, only users, teams, or apps that have been given permission can push to the protected branch." If administrators remain exempt, an administrator can still update the branch unless the no-bypass setting is enabled.

How can I stop unauthorized changes to GitHub Actions workflows?

Workflow files under .github/workflows are ordinary repository files, so a branch rule protects their merge into main only when the rule covers that branch. Require a pull request, review, and passing checks for the protected branch, and make the checks validate both application code and workflow changes. A workflow edit should not be able to weaken the very checks that guard it.

Require approval before changing .github/workflows

Use a ruleset when you need a path-specific control. Rulesets can restrict sensitive file paths and define the actors allowed to bypass the restriction. Configure the path pattern for .github/workflows/** (or the narrower workflow paths that matter), require the pull-request and review conditions for the target branch, and keep the bypass set to the smallest group that must perform emergency maintenance. On plans that support it, push rulesets can apply across the repository’s fork network, reducing the chance that a fork introduces an unreviewed workflow change through a permitted push path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Path protection complements, rather than replaces, branch protection. The branch rule still decides whether the resulting commit may land in main; the path rule adds a specific guard around workflow files that can alter build, deployment, or credential-handling behavior.

Classic branch-protection rules versus rulesets

Comparison axis Classic branch-protection rule Ruleset
Branch and tag scope Targets branches through a branch pattern, such as main or release/*. Uses a broader rule model that can target the repository’s refs according to the ruleset scope.
Push-versus-merge coverage Combines merge requirements with protected-branch push, force-push, and deletion settings. Can express push rules as well as merge-related requirements in a single policy model.
File-path restrictions Does not provide the path-focused workflow-file control described for rulesets. Can restrict sensitive paths, including workflow directories, when supported by the repository plan.
Fork-network behavior Applies to the repository’s protected branches. Push rulesets can apply across a repository’s fork network.
Bypass-actor granularity Uses branch restrictions and the administrator bypass setting. Defines explicit bypass actors for the ruleset, allowing a narrowly scoped exception.
Status-check and review requirements Directly exposes required reviews, required checks, and related branch gates. Can combine those requirements with path and push conditions in the ruleset model.
API manageability The protected-branch REST representation exposes the configured branch gates and restrictions for auditing. Rulesets provide a policy object suited to broader, centrally managed conditions; inspect the applicable ruleset representation as well as the branch endpoint.

Use a classic rule for a straightforward protected-branch gate. Add a ruleset when the policy must cover sensitive paths, push behavior, explicit bypass actors, or a fork network. Large repositories commonly use both: a branch rule for merge safety and a ruleset for workflow and repository-wide push controls.

Actions policies control what can execute

Branch protection governs what lands in a branch; it does not by itself decide who may start a workflow or which event types are trusted. Configure Actions policies separately.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
  • Actor policies: restrict which users, teams, or other actors may trigger workflows.
  • Event policies: limit high-risk events such as workflow_dispatch and pull_request_target. Treat events that run with repository credentials or elevated context as requiring explicit authorization.
  • Dependency lockfile protection: require action dependencies to be pinned so a moving action reference cannot silently change the code that executes.
  • Workflow checks: require checks that validate workflow syntax, permissions, dependency changes, and deployment behavior before a workflow edit can merge.

These policies should be aligned with the branch rule. For example, a pull request may be allowed to modify a workflow file, but the merge should wait for a review and for checks that inspect the resulting workflow. Separately, the Actions policy can prevent an untrusted actor or event from running that workflow.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why is my required status check still pending?

GitHub evaluates required checks on the latest commit proposed for the protected branch. A result from an older commit does not satisfy the requirement. The acceptable completed states include success, skipped, and neutral.

Check the workflow filters

Path and branch filters can prevent a workflow from running at all. If that workflow is marked required, no check is reported and the pull request remains pending. Review every paths, paths-ignore, branch, and event filter against the files and target branch in the pull request. Either make the workflow run for the required change or remove that check from the required list.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Check merge-queue support

If a merge queue is enabled, the workflow must include a merge_group trigger. A workflow that runs on ordinary pull-request events but not on the queue’s merge-group event cannot report the required result for the queued merge.

Check the expected source

A protected branch can require a check from a specific GitHub App. If an identically named check is produced by another app or integration, GitHub can reject it as the wrong source. Verify the producing App and the required-check configuration rather than relying on the check name alone.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the latest commit as the debugging boundary

Push a new commit only after confirming the workflow definition and filters. Then inspect the check run attached to that new commit. Re-running a result attached to an earlier commit does not satisfy a requirement tied to the current tip.

Auditing protection through the REST API

Periodic inspection catches configuration drift after a repository transfer, team change, or emergency exception. The protected-branch REST representation exposes required checks, required reviews, administrator enforcement, force-push and deletion settings, branch-creation blocking, conversation resolution, branch locking, and push restrictions.

Build an audit that records the expected policy for each protected branch and compares it with the API response. Flag a branch when:

  • the branch no longer requires a pull request or the required approval count has changed;
  • a required check is missing, renamed, or no longer tied to the expected GitHub App;
  • administrator enforcement is off;
  • force pushes or deletion are allowed;
  • an unexpected user, team, or App appears in the push-allow list;
  • conversation resolution, branch locking, or branch-creation blocking differs from policy.

Store the desired configuration as policy-as-code, review changes through the same pull-request process, and run the audit on a schedule. The API check is a verification layer; it does not replace a live test with a non-bypass user.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Deployment sequence and safe testing

  1. Identify every production and release branch pattern that needs protection.
  2. List the checks that must pass on the current commit and confirm each workflow reports for normal pull requests and, if used, merge-queue groups.
  3. Apply pull-request reviews, status checks, conversation resolution, and any signed-commit or linear-history requirements.
  4. Restrict push actors, disable force pushes and deletion, and enable administrator enforcement.
  5. Add a ruleset for workflow paths or fork-network push controls, defining only necessary bypass actors.
  6. Configure Actions actor, event, and dependency-lock policies.
  7. Test direct pushes, force pushes, deletion attempts, unapproved pull requests, stale checks, workflow-file edits, and administrator actions with accounts representing each role.
  8. Inspect the API representation and correct any difference between the intended and actual policy.

A protection design is complete only when both the merge path and the execution path are tested: an unauthorized commit must not land, and an unauthorized workflow must not run.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.