Modules

Module github

ballerinax/github Ballerina library

3.0.0

Overview

This GitHub connector client module provides capability to perform operations on major resource types such as Repositories, Issues, Pull Requests, Projects etc.

This module supports GitHub API v4 version and only allows to perform functions behalf of the user who is currently logged in.

Prerequisites

Before using this connector in your Ballerina application, complete the following:

  • Create account

  • Obtain token - To obtain a personal access token via which the connector can access the API, follow these steps

  • Configure the connector with obtained token

Quickstart

To use the GitHub connector in your Ballerina application, update the .bal file as follows:

Step 1: Import connector

First, import the ballerinax/github module into the Ballerina project as follows.

Copy
import ballerinax/github;

Step 2: Create a new connector instance

Create a github:ConnectionConfig using your GitHub personal access token and and initialize the connector with it.

Copy
ithub:ConnectionConfig config = {
   auth: {
       token: "authToken"
   }
;

ithub:Client githubClient = new (config);

Step 3: Invoke connector operation

  • Get All Open Pull Requests In A Repository
Copy
github:PullRequestList response = check githubClient->getPullRequests(<GitHub_Username>, <GitHub_Repository_Name>, github:PULL_REQUEST_OPEN, <Per_Page_Count>);
  • Use bal run command to compile and run the Ballerina program.

Import

import ballerinax/github;Copy

Metadata

Released date: almost 3 years ago

Version: 3.0.0

License: Apache-2.0


Compatibility

Platform: java11

Ballerina version: slbeta6


Pull count

Total: 17382

Current verison: 63


Weekly downloads


Source repository


Keywords

IT Operations/Source Control

Cost/Freemium


Contributors

Other versions

See more...