https://github.com/cdaringe/webhookup
create or delete GitHub webhooks, real fast, real easy :zap:
https://github.com/cdaringe/webhookup
cli github library webhook
Last synced: 5 months ago
JSON representation
create or delete GitHub webhooks, real fast, real easy :zap:
- Host: GitHub
- URL: https://github.com/cdaringe/webhookup
- Owner: cdaringe
- Created: 2018-10-09T03:15:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-23T23:37:37.000Z (almost 2 years ago)
- Last Synced: 2025-06-08T01:53:54.076Z (about 1 year ago)
- Topics: cli, github, library, webhook
- Language: JavaScript
- Homepage:
- Size: 470 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# webhookup
setup webhooks _quickly_ for your GitHub/GHE projects.
[](https://standardjs.com) [](https://github.com/semantic-release/semantic-release) [](https://greenkeeper.io/)
## usage
`npx webhookup [options]`. you can also `npm install -g webhookup` or `yarn global add webhookup`
## configuration
`webhookup` can be **configured through the CLI or the environment**. my preference is to set a few env vars and simply run `webhookup` in the current project to setup my most commonly used webhook, then override it only as needed with the CLI.
### env
a common env config could be:
```sh
export WEBHOOK_GITHUB_TOKEN=
export WEBHOOK_ENDPOINT=https:///payload
export WEBHOOK_SECRET=
export WEBHOOK_EVENTS=status,pull_request # https://developer.github.com/webhooks/#events
# export GITHUB_ENDPOINT # assume api.github.com
# export GITHUB_OWNER # let the cli discover it from your project
# export GITHUB_REPOSITORY # let the cli discover it from your project
```
then `cd /my/project && webhookup`. **please tread with caution** putting secrets in your env.
### cli
you can provide and/or squash any settings from the CLI:
```sh
$ webhookup --help
github webhooks library & cli
Usage
$ webhookup [options]
Options
--github, -g or env GITHUB_ENDPOINT. defaults to github.com's api
--owner, -o or env GITHUB_OWNER. repo owner/org. if none provided, tries to read owner from working directory
--repository, -r or env GITHUB_REPOSITORY. repo name. if none provided, tries to read from working directory
--token, -t or env WEBHOOK_GITHUB_TOKEN or GITHUB_TOKEN. github api token. must provide admin:repo_hook permission
--endpoint, -h or env WEBHOOK_ENDPOINT. url to the origin (host:) where your webhook listener lives
--secret, -s or env WEBHOOK_SECRET. github webhook secret. your hook service uses this secret to verify that request is legitimate.
--events, -e or env WEBHOOK_EVENTS. csv list of events. e.g. `status,push`
--purge, -p delete all webhooks for repo.
Examples
# minimal, if you configure your env for everything
$ webhookup
# pragmatic option 1, specify just events, cd to your github/.git enabled project,
# use your env for the rest
$ webhookup -e status,push
# pragmatic option 2, if your PWD is a github & .git enabled project
$ webhookup -t -h my.webhook.host.com -s -e status,push
# ignore PWD, specify org & repo
$ webhookup -o cdaringe -r webhookup
```
### tokens
your github token _must_ provide `admin:repo_hook` permission. you can visit [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new) to create new github API tokens.
