Skip to content

Latest commit

 

History

History
66 lines (46 loc) · 1.8 KB

README.md

File metadata and controls

66 lines (46 loc) · 1.8 KB

git-slack-notify

pic

  • Tracks new commits in multiple local Git repositories using git fetch && git rev-list
  • Reports them to Slack channels
  • Written in JavaScript — your grandmother can easily read it

Features

  • Super-easy no-brain installation
  • Filters auto-generated / non-informative messages (NPM version tags, quick fixes in MD files, merge commits)

TODO

  • Automated tests

Install

You will need NPM.

git clone http://github.com/xpl/git-slack-notify
cd git-slack-notify
npm install

Run

npm start

Configure

Default config name will be config.json. Running with other file:

npm start myconfig.json

If not found, it will be auto-generated with example data:

{
    accessToken: '<your Slack OAuth access token here>',

    fetchFrequency: 30000, // check for new commits each 30s

    repos: [                                    // you can track multiple repositories
        {
            name: 'Git Slack Notify',           // display name (optional, if not set, will be generated from `dir`)
            dir: process.cwd (),                // local git repo path
            channel: 'general',                 // where to post
            since: ''                           // this is auto-updated when new commits arrive
        }
    ]
}

Obtaining accessToken

  1. Create a new Slack App at https://api.slack.com/apps
  2. Activate the "Incoming webhooks" feature
  3. Click on "Install app to your team" (will generate the token)
  4. Under "OAuth & Permissions", grab your "OAuth Access Token"