pralarm

Slack bot which sends notifications when a GitHub organization's PR are older than a number of days


Keywords
slack, bot, github
License
MIT
Install
pip install pralarm==0.1

Documentation

pr-alarm-bot

Slack bot which sends notifications with organization's PR older than a number of days

Requirements

How to use

You have to add the following environment variables with your GitHub and Slack credentials:

  • GITHUB_USERNAME
  • GITHUB_PASSWORD
  • GITHUB_ORGANIZATION
  • SLACK_CHANNEL
  • SLACK_TOKEN

It is algo possible to add these variables in the config.py file.

Then, it is only necessary to add a file, for instance run.py with the following information:

from pralarm.github import GitHubIntegration
from pralarm.slack import SlackIntegration

github_client = GitHubIntegration(GITHUB_USERNAME, GITHUB_PASSWORD)
slack_client = SlackIntegration(SLACK_TOKEN)

older_pr = github_client.get_org_pull_requests_older_than_num_days(GITHUB_ORGANIZATION, num_days)

slack_client.send_message(SLACK_CHANNEL, your_message)

Run the program

Open the command line and execute:

python3 run.py

This will send your message to your slack channel.