Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dec 2, 2022 8:31:01 AM
Sep 29, 2021 10:29:38 AM
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.
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:
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.
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:
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.
How to: Qlik Application Automation for backing up and versioning Qlik Cloud apps on Github
Thanks for this article !
Is it possible to connect to Github Enterprise using this connector ?
Thanks
is "List My Repositories" only repositories the developer owns, or ones that they have access to? our testing so far seems to show it is just ones the developer owns...
Hi Ken,
"List My Repositories" should return all repositories that the logged user has access to:
thanks - I think we were hitting the issue described here:
https://community.qlik.com/t5/Qlik-Application-Automation/How-to-change-github-credentials-in-automa...
and
https://community.qlik.com/t5/Official-Support-Articles/Why-does-my-new-new-connection-automatically...
so far, after a lot of trial and error testing, we are not able to see all the repositories and there does not appear to be any docs on how to get these blocks to work to show all the repositories that the user used in the connection properties has access to.
confirmed with Qlik Support this week:
github connections are not yet supported in automations in QCG Qlik Cloud Government. They are supported in the regular qlik cloud saas product. maybe sometime in the future, we dont know if there is an estimated date for this yet in QCG.
https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_QlikAutomation/connector-blo...
could this article be updated to point out this is not available in QCG yet?