Automation of GitHub tasks with serverless actions


GitHub permissions can get complicated. There are nuances to understanding what an owner can do and what a member can do. In this way, as your organization grows, more restrictions can be placed on what members can do. Here is a problem that we encounter in my daily work:

We have a public presence on GitHub at;

Xyz members are not allowed to create repositories – or repos – by default;

New repo requests have been sent by email to the organization’s owners and are made manually. (Buuu.)

This tutorial shows a very easy way to require new repositories to be made for a GitHub organization. It involves asking members to request new repositories, filing questions in a specific repository (the example solution uses an instance of GitHub Enterprise, but any GitHub repository would work the same way). This allows multiple owners to view the same queue and provides a record of how many requests have been made. (Besides, I just wanted to work on serverless – in Portuguese, “without a server” – so that was a good excuse).

This is how it works at a high level:

A user details a problem on GitHub about a repo he wants to create;

When a problem is approved, a payload (in Portuguese, payload) is sent for a serverless action;

The serverless action triggers some Python code;

Using the Python requests module, you trigger GitHub APIs.

Upon completing this tutorial, you will understand how to:

Configure an action with IBM Cloud Functions;

Trigger an IBM Cloud Functions action with a webhook (in Portuguese, “hook web”);

Interact with the GitHub API.

See Also
GitHub Stops Using Racist Expressions Within The Scope Of The 'Black Lives Matter' Movement


Please enter your comment!
Please enter your name here