Skip to content

Instantly share code, notes, and snippets.

@florinel-chis
Last active December 20, 2015 23:29
Show Gist options
  • Save florinel-chis/6212916 to your computer and use it in GitHub Desktop.
Save florinel-chis/6212916 to your computer and use it in GitHub Desktop.
Shell script to create a pull_request hook (currently you cannot do this using the github interface)
#!/bin/bash
GIT_TOKEN="YOUR_TOKEN_HERE"
GIT_USER="YOUR_USER_HERE"
GIT_REPO="YOUR_REPO_HERE"
curl -X POST -H "Authorization: token $GIT_TOKEN" \
--data '{"name": "web","active": true,"events": ["pull_request"],"config": {"url": "http://your.url.here/"}}' \
https://api.github.com/repos/$GIT_USER/$GIT_REPO/hooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment