Skip to content

node app for slack bot integrations to report changes in gitlab projects

Notifications You must be signed in to change notification settings

ggkevinxing/slack-gitlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitLab Alerts for Slack

(as seen on the Slack API community page)

a node.js app that uses slack bot integrations to notify users when changes have been made to projects they have access to on gitlab

npm install

node index.js (mongodb required)

SETTING UP

  1. on the slack team, add a bot integration and place its token in a .env, under var name SLACKBOT_TOKEN

you can use .env.sample as an example to help you get started

  1. place a mongodb database link in the .env, under var name DATABASE_URI

  2. paste in your gitlab domain into the .env, under var name GITLAB

  3. run the app locally or elsewhere (i.e. heroku) and you can now interact with the bot and use commands

the app will clear out all stored projectIDs to monitor on start-up in order to avoid errors related to channels already being monitored when trying to poll again

COMMANDS

  • set <GitLab token>

    • // use this to save your GitLab token (found at /profile/account), you may also use "token", "settoken" and "updatetoken" instead of "set"
  • list

    • // lists all the projects you have access to
  • pollall <channel (optional)>

    • // will begin polling all projects you have access to, as well as look for new projects to poll that you were later given access to. notifications posted to specified channel, or direct message otherwise
    • // best used without the channel option, as anyone with access to the same project can stop monitoring in public channels at any time
  • poll <project name / project ID> <channel (optional)>

    • // will begin polling specified project and will post notifications to specified channel, or direct message otherwise
    • // best used without the channel option, as anyone with access to the same project can stop monitoring in public channels at any time
  • stop <project name / project ID> <channel (optional)>

    • // will stop polling specified project in specified channel, or if no channel is specified it will stop polling in your direct messages for that project if polling is being done
    • // can be called with cancel or clear as well

TO DO

  • reimplement stop * / stop . / stopall command to find user's available projects and stop monitoring them in DM channel (but don't allow clearing of public channels)

screenshots


About

node app for slack bot integrations to report changes in gitlab projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published