Skip to content

Instantly share code, notes, and snippets.

@akkomar
Created August 20, 2015 11:53
Show Gist options
  • Save akkomar/ea26cd9cefbb1d1c4c4b to your computer and use it in GitHub Desktop.
Save akkomar/ea26cd9cefbb1d1c4c4b to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys, os
input = sys.stdin.read()
oldrev, newrev, refname = input.rstrip().split(" ")
SUPER_USER_KEY_ID = 'key-ID'
user_key_id = os.environ['GL_ID']
if (refname == 'refs/heads/PROTECTED_BRANCH_ID' and user_key_id != SUPER_USER_KEY_ID):
print "Only SUPER USER can push to PROTECTED_BRANCH_ID branch!"
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment