Skip to content

Will notifies a the PaySplit Dev Slack Group whenever any teammate makes a commit.

License

Notifications You must be signed in to change notification settings

timomak/paysplit-CommitPing

Repository files navigation

CommitPing

Go Report Card Codacy Badge

Based on this class' project: BEW 2.5 Go Routines Class 7.

CommitPing allows you to set up your own personal monitor to ping you on slack whenever any commits are made on a repository that you set up.

How it works

  1. You set up a Webhook on Github to ping a POST route on this project.
  2. The Webhook will send a payload of data about the commit.
  3. Using a SlackAPI, send a custom message to a channel of your choice each time a commit is made to the Github Repo.

Instructions

Part 1: Create New Slack App

  1. Have these docs open and ready as you configure a Slack Bot User.
  2. Point your browser to the Create a Slack App page.
  3. Enter a name that fits the problem you're trying to solve.
  4. Select Product College workspace from the Workspace drop-down.
  5. Click the Create App button.
  6. On the sidebar, under the Features header, click Bot Users.
  7. Git your bot a display name and a default username.
  8. Click the Save Changes button.
  9. Go to OAuth & Permissions and scroll down to the Scopes > Select Permission Scopes text entry field.
  10. Add channels:history, channels:read, and channels:write permission scope and click Save Changes.
  11. Click Install App to Workplace, and make sure you set the contents of the dialog to match the below screenshot. This ensures your bot replies in a particular channel:#golang-slackbots. Make sure your OAuth dialog matches the following:

Part 2: Setup Project

  1. Fork this starter repo onto the server you're gonna be using.
  2. Clone the forked repo to your local machine and cd REPO_NAME.
  3. Create a .env file by running cp .env.sample .env.
  4. Paste the Bot Token from Step 9 in .env after BOT_OAUTH_ACCESS_TOKEN=.
  5. Type WEBHOOK=password the line below within the .env file.
  6. Run export GO111MODULE=on; go run main.go to start the server.

Part 3: Run Ngrok

  1. Install ngrok with npm install ngrok -g
  2. Run ngrok on the locally running server port ngrok http 3000
  3. Copy the link ngrok provides.
    • ngrok

Part 4: Set up Webhook

  1. Create a Github Webhook
    • Webhook
  2. Paste your Payload URL from Step 3 of Part 3.
  3. Set the settings to be the same.
  4. Set password as your Secret or whatever you set in Step 5 of Part 2.

DONE.

If you followed the instructions properly, you will be pinged over slack each time someone makes a commit to that repo. Like so:

Rubric

Student Name Total
(Possible)
Bonus
(Possible)
Total
(Earned)
Bonus
(Earned)
Final Score
(Points)
Final %
Timofey Makhlay 200 50 170 0 170 85%
Phase Criteria Points Score
Propose Repo Contents Matchgit Written Proposal 15 15
Propose Utility Has Purpose & Fulfills the Proposal 15 15
Implement Source Code Receives a B or Higher on Go Report Card 50 50
Implement Utility Can Persist Data 25 0
Implement Utility Incorporates a Third-Party API 25 25
Implement README Contains Go Report Card Badge at Top 5 5
Implement Source Code in Public GitHub Repo & Added to Tracker 5 5
Implement No Exposed Secrets in Source Code 5 5
Implement Properly Defined .gitignore 5 5
Implement Attribution Links in Comments for "Borrowed" Code 5 5
Deploy Shipped Live & Fully Usable 30 30
Document Installation & How to Use Documentation in README 15 15
Bonus 🌟 Add API Key Authentication to Your API 5 0
Bonus 🌟 Documentation Website, Link in README & Repo Header 5 0
Bonus 🌟 Test Suite with >80% Code Coverage 10 0
Bonus 🌟 Published Blog Post About Project 10 0
Bonus 🌟 Project Released on GoDoc.org 20 0

About

Will notifies a the PaySplit Dev Slack Group whenever any teammate makes a commit.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages