Skip to content
/ snowden Public

Notify users about watched files or folders in Github pull requests

License

Notifications You must be signed in to change notification settings

svera/snowden

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snowden Build Status

This little tool allows users to be notified when one or more of their watched files or folders are included in a new or updated Github pull request, so they can review the changes made on them.

Dependencies

Go >= 1.7

This program is designed to work in conjunction with https://github.com/adnanh/webhook. Take a look at its documentation to know more about how install and configure it.

You'll also need to register Snowden as a Slack application to obtain the credentials required to send messages. Go to https://api.slack.com/apps?new_app=1 for more information.

Usage

  • Download an install Snowden: go get github.com/svera/snowden

  • Create a configuration file etc/webhook/snowden.yml. You can follow the provided snowden.sample.yml as an example.

  • Add the following to webhooks' hooks.json configuration file and launch it:

    [
        {
            "id": "snowden",
            "execute-command": "/path/to/snowden/executable",
            "command-working-directory": "/path/of/working/directory",
            "response-message": "I got the payload!",
            "response-headers":
            [
                {
                    "name": "Access-Control-Allow-Origin",
                    "value": "*"
                }
            ],
            "pass-arguments-to-command":
            [
                {
                    "source": "payload",
                    "name": "action"
                },
                {
                    "source": "payload",
                    "name": "repository.owner.login"
                },
                {
                    "source": "payload",
                    "name": "repository.name"
                },      
                {
                    "source": "payload",
                    "name": "number"
                },
                {
                    "source": "payload",
                    "name": "pull_request.title"
                },
                {
                    "source": "payload",
                    "name": "pull_request.body"
                }            
            ]
        }
    ]
    
  • Head to your Github repository settings and add a new webhook that triggers with pull request events, setting its URL to <webhooks server domain>/hooks/snowden.

You can also run it manually (without relying on webhooks server) for testing purposes. Snowden expects 6 parameters, in this order:

  • The event that thrown the webhook. Snowden only responds to opened and reopened. Read https://developer.github.com/v3/activity/events/types/ for more information.
  • The pull request owner.
  • The repository name where the pull request is aimed.
  • The pull request number.
  • The pull request title.
  • The pull request description.

About

Notify users about watched files or folders in Github pull requests

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages