Is Github Contributions Calendar reflecting all efforts you do in yours on-line repositories (like Bitbucket or Gitlab)?

Example of the result obtained by reusing this solution
Solution’s big picture

Steps on Github:

Steps on Heroku:

  1. On heroku, create a new app. Name it this way: supposing my heroku user is neo, name it as neo-contributions-cal;
  2. Let’s configure our heroku application. On its details, access its Settings;
  3. On Settings, config the following vars: 1) my_name, this is your github name, e.g., Thomas A. Anderson; 2) my_email, this is the e-mail of your github account, example, neo@gmail.com; 3) my_user, this is your github user name, e.g. neo, 4) my_password, you github password (no worry here, although this wont’t be public at any moment, you can create a github personal access token for the command line anyway);
  4. More below, on Buildpacks area, add two buildpack in this order: 1st) Enter this as Buildpack: URL https://github.com/heroku/heroku-buildpack-apt; 2nd) heroku/python, this one you can select on the officially supported buildpacks list;
  5. Let’s configure the deploy now, select Deploy tab on your heroku app details;
  6. On the configuration of you app on heroku, select the deployment method as GitHub, and connect your github repository, in our example, it is neo/contributions-cal
  7. On Deploy tab yet, more below, on Manual deploy body, manually deploy the code located on github as an heroku app by clicking the button Deploy Branch. After awhile, you should be able to view your app.

Steps on Bitbucket (optional):

  1. Let’s setup a webhook, go to your online repository on Bitbucked.
  2. On your repository, access Settings menu, then Webhooks, then click the button Add webhook
  3. On the configuration of the webhook, set the Title to “neo’s github”.
  4. Set the URL to https://neo-contributions-cal.herokuapp.com/request
    The first part is the URL of your app, then the path request instruct our app to perform an update on github repository
  5. Continuing the configuration, mark the SSL / TLS checkbox, so we skip certificate verification. The Repository push is our trigger, selected by default.
  6. Now, just save and we are read to test our solution.

Steps on Gitlab (optional):

  1. Let’s setup a webhook, go to your online repository on GitLab.
  2. Go Settings -> Integrations
  3. Set the URL to https://neo-contributions-cal.herokuapp.com/request
    The first part is the URL of your app, then the path request instruct our app to perform an update on github repository.
    The Push events is our trigger, selected by default.
  4. Unmark Enable SSL verification checkbox
  5. Add by clicking the button Add webhook
  6. Now, just save and we are read to test our solution.

Steps on local Git (optional):

  1. Let’s setup a hook, go to your local project directory, then open “.git\hooks”. The directory “.git” is hidden, and it contain files used by Git.
  2. Locate pre-push.sample file, do a copy, renaming it to pre-push
    The extension .sample prevents it to be executed when a push command is hit.
  3. Edit pre-push file so its content is (remember to change neo by your user always) equal to the one more below. Attention: the command below is going run the program curl , so make sure it is installed on your machine and in the path.

    If on a Windows OS, like Windows 10:
    #!/bin/sh
    start /MIN curl
    -d “{\”author\”:\”neo\”, \”hash\”:\”= = = =\”, \”summary\”:\”push done from local git\”}” -H “X-Git-Event: Push Hook” -H “Content-Type: application/json” -X POST https://neo-contributions-cal.herokuapp.com/request
    exit 0

    If on a Linux OS, like Ubuntu:
    #!/bin/sh
    curl -d ‘{“author”:”
    neo”, “hash”:”= = = =”, “summary”:”push done from local git”}’ -H ‘X-Git-Event: Push Hook’ -H ‘Content-Type: application/json’ -X POST https://neo-contributions-cal.herokuapp.com/request
    exit 0
  4. Now, we are ready to test our solution.

Testing the solution:

  1. To test this solution perform a push on any repository where you configured the webook or local hook.
  2. Then go to github, and check that a push occurred there too, an evidence that you just used your Git skills.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Kotlin Multiplatform: Static Library without Cocoapods

Essential CSS layout properties

CSS Animations

ThreadHold With Otsu

ThreadHold With Otsu

Stay up-to-date and Ahead in Web Development

How to Scrap API Using Python

EKS RBAC Setup using OKTA

Windows 11 Install— Drive Partition Problem

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Flaviano Flauber

Flaviano Flauber

More from Medium

Enabling OJDBC level logging in Mule4

What are API’s? How do I use them?

Server Response Cycle

What is API in Web Development? 2022

Tutorial Series: Set Up Automatic Deployment on CPanel with Git (Pull Method)