Require review before a force push. Blocks history rewrites on protected branches and escalates protection-setting changes.
For: Repo admins who want branch protection to be provable, not just configured
Escalates a force push to a protected branch until a named reviewer signs it.
Blocks a rewrite of already-published history on a protected branch.
Escalates any change to the branch-protection settings themselves.
# GitHub Branch-Protection Gate
# Fork: set protected_branches, then flip mode to enforce when the shadow
# verdicts look right.
apiVersion: decionis.dev/v1
kind: PolicyPack
metadata:
name: github-branch-protection-gate
surface: github
workflow_key: github_branch_protection
standards: [SOC2-CC8.1, ISO27001-A.8.32]
defaults:
mode: shadow
emit_dossier: true
comment_pr: true
protected_branches: [main, master, release/*, production]
rules:
- name: force_push_review_requirement
when: "event == 'push'"
decision: |
ESCALATE IF push.forced == true AND ref in protected_branches
ALLOW OTHERWISE
reason_code: force_push_requires_review
- name: history_rewrite_block
when: "event == 'push'"
decision: |
BLOCK IF push.rewrites_published_history == true AND ref in protected_branches
ALLOW OTHERWISE
reason_code: published_history_rewrite
- name: protection_setting_change
when: "event == 'branch_protection_rule'"
decision: |
ESCALATE IF always
reason_code: branch_protection_changed
Fork it, change the thresholds to match your environment, and deploy in shadow mode first — it defaults to listen-only so nothing in your live pipeline changes.
Drops into any workflow YAML in one line. Verdicts surface on the PR + the run summary.
# .github/workflows/deploy.yml
- uses: decionis/govern@v1
with:
api-key: ${{ secrets.DECIONIS_API_KEY }}
org-id: ${{ secrets.DECIONIS_ORG_ID }}
workflow-key: github_deploy_approval
mode: shadow # ← every verdict recorded; step never fails
comment-pr: 'true' # ← post verdict + verify URL on the PR
Ships in shadow mode — every verdict is recorded, nothing is blocked.
This recipe is one step in a path. The same five steps apply to every recipe in the exchange.
Run the policy against a realistic action in the browser. Push it past what the rules allow and watch the verdict come back. No account.
See exactly what was decided and why: the rule that fired, the evidence it read, the policy version in force, and an Ed25519 signature you can verify yourself.
Measure what the policy would have caught on your own traffic without touching the live path. Every recipe defaults to shadow, so the first deployment carries no execution risk.
Point the same policy at the system where the action actually originates — a checkout, an ERP posting, a Zap, an agent's tool call.
Publish the proof: a public verification link, an embeddable badge, a PR comment, or an anonymized shadow-mode finding. This is how the next person discovers Decionis.