All Projects β†’ rootstrap β†’ pull_requests_to_slack

rootstrap / pull_requests_to_slack

Licence: MIT license
Send Github pull request notifications to Slack

Programming Languages

ruby
36898 projects - #4 most used programming language
API Blueprint
66 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
CSS
56736 projects
Haml
164 projects

Projects that are alternatives of or similar to pull requests to slack

redmine merge request links
Display links to associated Gitlab merge requests and GitHub pull requests on Redmine's issue page.
Stars: ✭ 32 (+52.38%)
Mutual labels:  pull-requests
ok-to-test
Example workflow configuration showing how to use GitHub Actions secrets in pull requests from forks πŸ΄πŸ”‘
Stars: ✭ 58 (+176.19%)
Mutual labels:  pull-requests
Prinder
Free Pull Request reminder for Github. Has configurations to post reminders to Slack and email along with jinja templating
Stars: ✭ 21 (+0%)
Mutual labels:  pull-requests
prlint
GitHub App for linting pull request meta data
Stars: ✭ 122 (+480.95%)
Mutual labels:  pull-requests
action-pr-title
Github action to enforce Pull Request title conventions
Stars: ✭ 83 (+295.24%)
Mutual labels:  pull-requests
getting-started
The world's most approachable open source project.
Stars: ✭ 24 (+14.29%)
Mutual labels:  pull-requests
showmyprs.com
See all your Open Source contributions in one place
Stars: ✭ 30 (+42.86%)
Mutual labels:  pull-requests
vscode-github
GitHub Support for vscode
Stars: ✭ 124 (+490.48%)
Mutual labels:  pull-requests
Raunaksingh-hacktober-2020
Welcome to Hackertober fest 2020
Stars: ✭ 7 (-66.67%)
Mutual labels:  pull-requests
Hacktoberfest
Hacktoberfest 2020 Beginner's Friendly Repository
Stars: ✭ 46 (+119.05%)
Mutual labels:  pull-requests
branch-switcher
a GitHub bot that switches the base branch of pull requests to the preferred branch
Stars: ✭ 15 (-28.57%)
Mutual labels:  pull-requests
tailor
GitHub bot that validates patches before they can be merged
Stars: ✭ 18 (-14.29%)
Mutual labels:  pull-requests
code-review-culture
πŸ“– The art of cultivating a strong dev culture in your team.
Stars: ✭ 19 (-9.52%)
Mutual labels:  pull-requests
release-changelog-builder-action
A GitHub action that builds your release notes / changelog fast, easy and exactly the way you want.
Stars: ✭ 515 (+2352.38%)
Mutual labels:  pull-requests
assign-author
GitHub Actions to assign author to issue or PR
Stars: ✭ 55 (+161.9%)
Mutual labels:  pull-requests
scalafmt-probot
πŸ€–Github bot for checking code formatting with scalafmt
Stars: ✭ 15 (-28.57%)
Mutual labels:  pull-requests
aloba
πŸ€– [Myrmica Aloba 🐜] Bot: Add labels and milestone on pull requests and issues.
Stars: ✭ 18 (-14.29%)
Mutual labels:  pull-requests
github-task-manager
receive github hook, notify agent, receive task results, notify github
Stars: ✭ 13 (-38.1%)
Mutual labels:  pull-requests
hacktoberfest
Contribute to this repo for your T-shirt, must be relevant that can add some value to this repo.
Stars: ✭ 33 (+57.14%)
Mutual labels:  pull-requests
Hacktoberfest-Banned-The-Repo-Guys-Sorry-For-Your-Time-and-effort
A beginner-friendly open source repository to create your first pull request.
Stars: ✭ 27 (+28.57%)
Mutual labels:  pull-requests

Rootstrap Pull request to Slack

Build Status Maintainability Test Coverage

Send Github pull request notifications to Slack.

  • Each time a PR is created in your organization it will send a message to a specific Slack channel with a link to the PR and the technology emoji used.
  • When the PR is merged it will add a merged reaction emoji.

Screen Shot 2019-08-02 at 11 06 30 AM

  • You can add \slack `This is a small pr @slack_user` at the end of the PR's description to add a message to the notification and to notify specific slack users.

Screen Shot 2019-08-02 at 11 11 30 AM

Make sure to use ` ` in the message in case the slack user name is the same a someone github name, so the github user is not notified. Screen Shot 2019-08-02 at 11 54 58 AM

  • It will not send a notification if the PR is a draft
  • It will remove the notification if the PR has an ON HOLD and resend the notification when the label is removed.

Installation

  1. Clone this repo
  2. Install PostgreSQL in case you don't have it
  3. Create your database.yml and application.yml files. There are sample files in /config
  4. bundle install
  5. Generate a secret key with rake secret and paste this value into the application.yml.
  6. Fill the SLACK_API_TOKEN and SLACK_BOT_TOKEN in application.yml. To get the credentials: log in to https://api.slack.com/apps, select your application and then click OAuth Tokens & Redirect URLs. SLACK_API_TOKEN is the OAuth Access Token and SLACK_BOT_TOKEN is Bot User OAuth Access Token
  7. rails db:create
  8. rails db:migrate
  9. rails db:seed # this will create an admin with [email protected]:password
  10. npm install -g ngrok Install Ngrok
  11. rspec and make sure all tests pass
  12. rails s
  13. You are ready!

How to test the webhook locally?

  • Create a dummy repository in github with a couple branches.
  • Run server: rails s -p 3001
  • In another terminal run ngrok: ngrok http 3001
  • Copy ngrok url to github configuration page (settings->webhooks) http://xxxxxxx.ngrok.io/api/v1/notifications_filter
  • Change CHANNEL in SlackNotificationService to your @name or #some_test_channel
  • Create/edit pull request adding or removing labels. This will execute the webhook.

ActiveAdmin page

You can access the admin page at http://localhost:3001/admin/users and add users that you want to ignore

Deploy to Heroku

Install heroku cli https://devcenter.heroku.com/articles/heroku-cli#download-and-install

  • Setup:
heroku login
enter credentials
heroku git:remote -a rootstrap-pull-request-to-slack
  • Push:
git push heroku master

Docs

Ngrok

Public URLs for exposing your local web server https://ngrok.com/

Github Hooks

Info about github hooks and Pull request payload

https://developer.github.com/webhooks/configuring/ https://developer.github.com/v3/activity/events/types/#pullrequestevent

Slack methods

https://api.slack.com/methods

Contributing

Bug reports (please use Issues) and pull requests are welcome on GitHub at https://github.com/rootstrap/pull_requests_to_slack/issues. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The library is available as open source under the terms of the MIT License.

Credits

Github for Slack is maintained by Rootstrap with the help of our contributors.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].