Skip to content

postcursor-laboratories/mattermost-github-integration

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github integration for Mattermost

Inspired by mattermost-integration-gitlab this program creates a server using flask that listens for incoming GitHub event webhooks. These are then processed, formatted, and eventually forwarded to Mattermost where they are displayed inside a specified channel.

Requirements

  • Python
  • Flask (install with pip install flask)
  • requests (install with pip install requests)

Usage

Copy config.template to config.py and edit it with your details. For example:

USERNAME = "Github"
ICON_URL = "yourdomain.org/github.png"
MATTERMOST_WEBHOOK_URLS = {
    'default' : ("yourdomain.org/hooks/hookid", "off-topic"),
    'teamname/repositoryname' : ("yourdomain.org/hooks/hookid2", "repochannel"),
    'teamname' : ("yourdomain.org/hooks/hookid3", "town-square")
}
SECRET = 'secretkey'
SHOW_AVATARS = True

GitHub messages can be delegated to different Mattermost hooks. The order is as follows: First try to find a hook for the repositories full name. If that fails, try to find a hook for the organisation name. Otherwise use the default hook.

The server is listening by default on port 5000. Make sure to point your Github webhooks to http://yourdomain.org:5000.

Start the server with python server.py.

If you don't want to use a secret set the field to None.

About

GitHub integration for Mattermost

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%