Module github

ballerinax/github Ballerina library

4.5.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
stream<github:PullRequest,github:Error?> response = check githubClient->getPullRequests(<GitHub_Username>, <GitHub_Repository_Name>, github:PULL_REQUEST_OPEN);
  • Use bal run command to compile and run the Ballerina program.

Import

import ballerinax/github;Copy

Metadata

Released date: about 1 year ago

Version: 4.5.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.4.1

GraalVM compatible: Yes


Pull count

Total: 15474

Current verison: 571


Weekly downloads


Source repository


Keywords

IT Operations/Source Control

Cost/Freemium


Contributors

Other versions

See more...