https://github.com/xpl/git-slack-notify
Sends Slack notifications for new commits in Git repositories
https://github.com/xpl/git-slack-notify
daemon git slack slack-bot slackapi slackbot watchdog
Last synced: 6 months ago
JSON representation
Sends Slack notifications for new commits in Git repositories
- Host: GitHub
- URL: https://github.com/xpl/git-slack-notify
- Owner: xpl
- License: unlicense
- Created: 2017-05-26T12:10:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-06T04:05:23.000Z (over 5 years ago)
- Last Synced: 2025-03-27T02:39:21.782Z (7 months ago)
- Topics: daemon, git, slack, slack-bot, slackapi, slackbot, watchdog
- Language: JavaScript
- Size: 102 KB
- Stars: 12
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-slack-notify

- [x] Tracks new commits in multiple local Git repositories using `git fetch && git rev-list`
- [x] Reports them to Slack channels
- [x] Written in JavaScript — [your grandmother can easily read it](https://github.com/xpl/git-slack-notify/blob/master/git-slack-notify.js)## Features
- [x] Super-easy no-brain installation
- [x] Filters auto-generated / non-informative messages (NPM version tags, quick fixes in MD files, merge commits)## TODO
- [ ] Automated tests
## Install
You will need [NPM](https://www.npmjs.com/get-npm).
```bash
git clone http://github.com/xpl/git-slack-notify
cd git-slack-notify
npm install
```## Run
```bash
npm start
```## Configure
Default config name will be `config.json`. Running with other file:
```bash
npm start myconfig.json
```If not found, it will be auto-generated with example data:
```
{
accessToken: '',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](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"_