Skip to content

Aj-vrod/github-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-notifier

Have granular control over what GitHub events you are notified of. No more broad repository events calling your entire team or having to subscribe to all issues creation.

How does it work?

This service runs in an isolated Docker container in the user's machine. That way it can use the credentials from the user and all information will never leave their local machine.

With a simple POST REST request, the user can subscribe to a single PR by providing the URL in the body and this service will start the check process:

  1. requests to GitHub current state of the PR
  2. stores that state in memory
  3. Sleeps for 60s
  4. requests to Github the latest state of that same PR
  5. Compares latest with previous state
  6. If changed, sends a message to a given Slack channel
  7. If it didn't change, sleep for 60s

Usage (Recommended)

  1. Build the image with Docker
docker build -t gn .
  1. Run the github-notifier image passing the required environmental variables
docker run \
  -e SLACK_WEBHOOK_URL="MY_SLACK_TOKEN" \
  -e GITHUB_TOKEN="MY_GH_TOKEN" \
  -e USER_EMAIL="change@me.com" \
  -e USERNAME="change-me" \
  -p 8001:8001 -d gn:latest
  1. Subscribe to a PR
curl -X POST http://localhost:8001/api/v1/subscribe \
-d '{"pr_url": "https://github.com/my-org/my-repo/pull/1"}'

TODOs

  • CLI command for subscribe
  • /unsubscribe
  • CLI command for unsubscribe
  • Refactor client types and tests
  • Ignore my own comments and commits
  • Include approvals
  • Add mutex lock for storage
  • Add lint and test workflows
  • Create Dockerfile
  • Add Docker build and deploy workflow
  • Add k8s manifests
  • Use better logger

About

Granular notification service for github activity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors