Skip to main content

Github - How to get started with Github in Automations

100% helpful (1/1)
cancel
Showing results for 
Search instead for 
Did you mean: 
Marius_Nuca
Support
Support

Github - How to get started with Github in Automations

Last Update:

Dec 2, 2022 8:31:01 AM

Updated By:

Sonja_Bauernfeind

Created date:

Sep 29, 2021 10:29:38 AM

Attachments

This article gives an overview of the available blocks in the Github connector in Qlik Application Automation. It will also go over some basic examples of retrieving file/blob contents from your repos as well as other functionalities within a GitHub account.

As with most connectors provided for automations the authentication for this connector is based on the oAuth2 Protocol, so when connecting to it you provide the user name and password of the account directly to the Github platform to request access so it is done in the most secure manner there is.

Marius_Nuca_0-1632923756663.png

Let's now go over a few basic examples of how to use the Github connector:

How to list owned repositories and check their contents from your Github account:

  1. Create an automation;
  2. From the left menu, select the Github connector;
  3. drag and drop the "List my repositories" block
  4. drag and drop the "List repositories contents" block inside the loop created by the first block:

Marius_Nuca_0-1632924247867.png

Now the "list my repositories" block offers a couple of filtering options depending what result you want (all repos or just the private or public ones and if you want the result to come in sorted by some rule) but they are mostly optional. Not filling them in will return by default all repositories.

As for the "List repository contents" block you will need to fill in the username you use for your github account as well as the repository name which can be filled in with the results gotten from the first block. You can leave the path parameter empty to get the contents from the root folder or you can specify a path and the contents of that path will be returned.

Marius_Nuca_1-1632924562097.png

As stated, if you expect to retrieve only one record, the use of "get repository content" block is more better suited. Also, you might want to switch this "List repository contents" block On Error status to either warning or ignore since Github API platform returns a 404 error if one of the queried repositories is empty.

Now if you are planning to use the "Get repository content" block another warning should be mentioned and that this block only works for files or blobs up to a maximum of 1 MB in size, as per Githubs platform limitations. The response of this block should look like:

Marius_Nuca_2-1632924945179.png

As you can see we have a couple of information stubs of that file, but most importantly from here is the SHA property, which is needed if you are planning to later on use the "Create or update file contents" block, required input parameter for the update of a file/blob.

Now if you're planning on updating files that are bigger than 1MB and you require the SHA of that file, we suggest using the list repository contents block and search for the required file and SHA in that result.

As for other functionalities of the Github connector we support also getting and listing commits or issues present in a repository, listing of users and many other requests but, if you are in need of a request that isn't present, we also offer the functionality to create your own requests to the Github API by making use of the RAW API blocks. These API blocks and their uses are explained in a separate article.

You can find attached to this article a simple JSON example which you can upload to your workspace, if you want to see a quick example of how to use version control to back up your QCS apps I suggest visiting the related article.

The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.

Related Content

How to: Qlik Application Automation for backing up and versioning Qlik Cloud apps on Github

Tags (1)
Labels (2)
Version history
Last update:
‎2022-12-02 08:31 AM
Updated by: