Browse Source

chore: Prevent pushing to master (#57400)

Matt Gaunt-Seo @ Sentry.io 1 year ago
parent
commit
e40da3bb43
1 changed files with 9 additions and 0 deletions
  1. 9 0
      .pre-commit-config.yaml

+ 9 - 0
.pre-commit-config.yaml

@@ -1,3 +1,5 @@
+default_install_hook_types: ["pre-commit", "pre-push"]
+
 exclude: >
     (?x)(
         LICENSE$|
@@ -57,6 +59,13 @@ repos:
       language: pygrep
       types: [python]
       exclude: ^src/sentry/metrics/minimetrics.py$
+    - id: prevent-push
+      name: prevent pushing master
+      stages: [pre-push]
+      entry: bash -c 'test "$PRE_COMMIT_REMOTE_BRANCH" != "refs/heads/master"'
+      always_run: true
+      pass_filenames: false
+      language: system
 
 -   repo: https://github.com/pre-commit/pygrep-hooks
     rev: v1.10.0