package
0.40.0-beta
Repository: https://github.com/instill-ai/pipeline-backend.git
Documentation: pkg.go.dev

# README


title: "GitHub" lang: "en-US" draft: false description: "Learn about how to set up a VDP GitHub component https://github.com/instill-ai/instill-core"

The GitHub component is an application component that allows users to do anything available on GitHub. It can carry out the following tasks:

Release Stage

Alpha

Configuration

The component definition and tasks are defined in the definition.json and tasks.json files respectively.

Setup

In order to communicate with GitHub, the following connection details need to be provided. You may specify them directly in a pipeline recipe as key-value pairs within the component's setup block, or you can create a Connection from the Integration Settings page and reference the whole setup as setup: ${connection.<my-connection-id>}.

FieldField IDTypeNote
Token (required)tokenstringFill in your GitHub access token for advanced usages. For more information about how to create tokens, please refer to the github settings.

Supported Tasks

List Pull Requests

Get the list of all pull requests in a repository. Detailed information about each commit in a PR is omitted, please use the Get Commit task or the Get Pull Request task to get the details of a commit.

InputIDTypeDescription
Task ID (required)taskstringTASK_LIST_PULL_REQUESTS
Owner (required)ownerstringOwner of the repository
Repository (required)repositorystringRepository name
StatestatestringState of the PRs, including open, closed, all. Default is open
SortsortstringSort the PRs by created, updated, popularity, or long-running. Default is created
DirectiondirectionstringDirection of the sort, including asc or desc. Default is desc
PagepageintegerPage number of the results to fetch. Default is 1
Per Pageper-pageintegerNumber of results to fetch per page. Default is 30
OutputIDTypeDescription
Pull Requestspull-requestsarray[object]An array of PRs
Output Objects in List Pull Requests

Pull Requests

FieldField IDTypeNote
PR basebasestringbase commit of the PR (in SHA value)
PR bodybodystringBody of the PR
Number of PR commentscomments-numintegernumber of comments on the PR
Commitscommitsarraycommits in the PR
Number of PR commitscommits-numintegernumber of commits in the PR
PR diff urldiff-urlstringurl to the diff of the PR
PR headheadstringhead commit of the PR (in SHA value)
PR ididintegerid of the PR
PR numbernumberintegernumber of the PR
Number of PR review commentsreview-comments-numintegernumber of review comments in the PR
PR statestatestringstate of the PR
PR TitletitlestringTitle of the PR

Commits

FieldField IDTypeNote
Filesfilesarrayfiles in the commit
Commit messagemessagestringmessage of the commit
Commit SHAshastringSHA of the commit
Commit statsstatsobjectstats of changes

Commit Stats

FieldField IDTypeNote
Additionsadditionsintegernumber of additions in the commit
Total changeschangesintegertotal number of changes in the commit
Deletionsdeletionsintegernumber of deletions in the commit

Files

FieldField IDTypeNote
Additionsadditionsintegernumber of additions in the commit
Total changeschangesintegertotal number of changes in the commit
Deletionsdeletionsintegernumber of deletions in the commit
File namefilenamestringname of the file
Patchpatchstringpatch of the file

Get Pull Request

Get a pull request from a repository, given the PR number. This will default to the latest PR if no PR number is provided

InputIDTypeDescription
Task ID (required)taskstringTASK_GET_PULL_REQUEST
Owner (required)ownerstringOwner of the repository
Repository (required)repositorystringRepository name
PR Numberpr-numberintegerNumber of the PR. 0 for the latest PR
OutputIDTypeDescription
PR id (optional)idintegerid of the PR
PR number (optional)numberintegernumber of the PR
PR state (optional)statestringstate of the PR
PR Title (optional)titlestringTitle of the PR
PR body (optional)bodystringBody of the PR
PR diff url (optional)diff-urlstringurl to the diff of the PR
PR head (optional)headstringhead commit of the PR (in SHA value)
PR base (optional)basestringbase commit of the PR (in SHA value)
Number of PR comments (optional)comments-numintegernumber of comments on the PR
Number of PR commits (optional)commits-numintegernumber of commits in the PR
Number of PR review comments (optional)review-comments-numintegernumber of review comments in the PR
Commits (optional)commitsarray[object]commits in the PR
Output Objects in Get Pull Request

Commits

FieldField IDTypeNote
Filesfilesarrayfiles in the commit
Commit messagemessagestringmessage of the commit
Commit SHAshastringSHA of the commit
Commit statsstatsobjectstats of changes

Commit Stats

FieldField IDTypeNote
Additionsadditionsintegernumber of additions in the commit
Total changeschangesintegertotal number of changes in the commit
Deletionsdeletionsintegernumber of deletions in the commit

Files

FieldField IDTypeNote
Additionsadditionsintegernumber of additions in the commit
Total changeschangesintegertotal number of changes in the commit
Deletionsdeletionsintegernumber of deletions in the commit
File namefilenamestringname of the file
Patchpatchstringpatch of the file

Get Commit

Get a commit from a repository, given the commit SHA

InputIDTypeDescription
Task ID (required)taskstringTASK_GET_COMMIT
Owner (required)ownerstringOwner of the repository
Repository (required)repositorystringRepository name
Commit SHA (required)shastringSHA of the commit
OutputIDTypeDescription
Commit SHA (optional)shastringSHA of the commit
Commit message (optional)messagestringmessage of the commit
Commit stats (optional)statsobjectstats of changes
Files (optional)filesarray[object]files in the commit
Output Objects in Get Commit

Commit Stats

FieldField IDTypeNote
Additionsadditionsintegernumber of additions in the commit
Total changeschangesintegertotal number of changes in the commit
Deletionsdeletionsintegernumber of deletions in the commit

Files

FieldField IDTypeNote
Additionsadditionsintegernumber of additions in the commit
Total changeschangesintegertotal number of changes in the commit
Deletionsdeletionsintegernumber of deletions in the commit
File namefilenamestringname of the file
Patchpatchstringpatch of the file

List Review Comments

Get the review comments in a pull request. The comments can be on a specific line or on the PR as a whole.

InputIDTypeDescription
Task ID (required)taskstringTASK_LIST_REVIEW_COMMENTS
Owner (required)ownerstringOwner of the repository
Repository (required)repositorystringRepository name
PR Numberpr-numberintegerNumber of the PR. Default is 0, which retrieves all comments on all PRs in the repository
SortsortstringSort the comments by created, updated. Default is created
DirectiondirectionstringDirection of the sort, including asc or desc. Default is desc
SincesincestringOnly comments updated at or after this time are returned. Default is 2021-01-01T00:00:00Z
PagepageintegerPage number of the results to fetch. Default is 1
Per Pageper-pageintegerNumber of results to fetch per page. Default is 30
OutputIDTypeDescription
Commentscommentsarray[object]An array of comments
Output Objects in List Review Comments

Comments

FieldField IDTypeNote
Comment bodybodystringBody of the comment
Commit SHAcommitIdstringSHA of the commit on which you want to comment
Comment created atcreated-atstringTime the comment was created
Comment ididintegerID of the comment
In Reply Toin-reply-to-idintegerID of the comment this comment is in reply to
Comment end linelineintegerThe line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to.
Comment pathpathstringPath of the file the comment is on
Comment end sidesidestringSide of the end line, can be one of: LEFT, RIGHT, side. LEFT is the left side of the diff (deletion), RIGHT is the right side of the diff (addition), and side is the comment on the PR as a whole. Default is side.
Comment start linestart-lineintegerThe first line in the pull request diff that your multi-line comment applies to. Only multi-line comment needs to fill this field.
Comment start sidestart-sidestringSide of the start line, can be one of: LEFT, RIGHT, side. LEFT is the left side of the diff (deletion), RIGHT is the right side of the diff (addition), and side is the comment on the PR as a whole. Default is side.
Comment typesubject-typestringSubject type of the comment, can be one of: line, file. Default is line
Comment updated atupdated-atstringTime the comment was updated
UseruserobjectUser who created the comment

User

FieldField IDTypeNote
User ididintegerID of the user
User URLurlstringURL of the user

Create Review Comment

Create a review comment in a pull request. The comment can be a general comment or a review comment. The comment can be on a specific line or on the PR as a whole.

InputIDTypeDescription
Task ID (required)taskstringTASK_CREATE_REVIEW_COMMENT
Owner (required)ownerstringOwner of the repository
Repository (required)repositorystringRepository name
PR Number (required)pr-numberintegerNumber of the PR
Comment (required)commentobjectThe comment to be added
Input Objects in Create Review Comment

Comment

The comment to be added

FieldField IDTypeNote
Comment bodybodystringBody of the comment
Commit SHAcommit-idstringSHA of the commit on which you want to comment
Comment end linelineintegerThe line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to.
Comment pathpathstringPath of the file the comment is on
Comment end sidesidestringSide of the end line, can be one of: LEFT, RIGHT, side. LEFT is the left side of the diff (deletion), RIGHT is the right side of the diff (addition), and side is the comment on the PR as a whole. Default is side.
Enum values
  • LEFT
  • RIGHT
  • side
Comment start linestart-lineintegerThe first line in the pull request diff that your multi-line comment applies to. Only multi-line comment needs to fill this field.
Comment start sidestart-sidestringSide of the start line, can be one of: LEFT, RIGHT, side. LEFT is the left side of the diff (deletion), RIGHT is the right side of the diff (addition), and side is the comment on the PR as a whole. Default is side.
Enum values
  • LEFT
  • RIGHT
  • side
Comment typesubject-typestringSubject type of the comment, can be one of: line, file. Default is line
Enum values
  • line
  • file
OutputIDTypeDescription
Comment id (optional)idintegerID of the comment
In Reply To (optional)in-reply-to-idintegerID of the comment this comment is in reply to
Commit SHA (optional)commitIdstringSHA of the commit on which you want to comment
Comment body (optional)bodystringBody of the comment
Comment path (optional)pathstringPath of the file the comment is on
Comment end line (optional)lineintegerThe line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to.
Comment start line (optional)start-lineintegerThe first line in the pull request diff that your multi-line comment applies to. Only multi-line comment needs to fill this field.
Comment end side (optional)sidestringSide of the end line, can be one of: LEFT, RIGHT, side. LEFT is the left side of the diff (deletion), RIGHT is the right side of the diff (addition), and side is the comment on the PR as a whole. Default is side.
Comment start side (optional)start-sidestringSide of the start line, can be one of: LEFT, RIGHT, side. LEFT is the left side of the diff (deletion), RIGHT is the right side of the diff (addition), and side is the comment on the PR as a whole. Default is side.
Comment type (optional)subject-typestringSubject type of the comment, can be one of: line, file. Default is line
Comment created at (optional)created-atstringTime the comment was created
Comment updated at (optional)updated-atstringTime the comment was updated
User (optional)userobjectUser who created the comment
Output Objects in Create Review Comment

User

FieldField IDTypeNote
User ididintegerID of the user
User URLurlstringURL of the user

List Issues

Get the list of all issues in a repository,This can be a pull request or a general issue, and you can tell by the is-pull-request field.

InputIDTypeDescription
Task ID (required)taskstringTASK_LIST_ISSUES
Owner (required)ownerstringOwner of the repository
Repository (required)repositorystringRepository name
StatestatestringState of the issues, can be one of: open, closed, all. Default is open
SortsortstringSort the issues by created, updated, popularity, or long-running. Default is created
DirectiondirectionstringDirection of the sort, can be one of: asc, desc. Default is desc
SincesincestringOnly issues updated at or after this time are returned. Default is 2021-01-01T00:00:00Z
No Pull Requestno-pull-requestbooleanWhether to not include pull requests in the response. Since issue and pr use the same indexing system in GitHub, the API returns all relevant objects (issues and pr). Default is false
PagepageintegerPage number of the results to fetch. Default is 1
Per Pageper-pageintegerNumber of results to fetch per page. Default is 30
OutputIDTypeDescription
Issuesissuesarray[object]An array of issues
Output Objects in List Issues

Issues

FieldField IDTypeNote
AssigneeassigneestringAssignee of the issue
AssigneesassigneesarrayAssignees of the issue
Issue bodybodystringBody of the issue
Is Pull Requestis-pull-requestbooleanWhether the issue is a pull request
LabelslabelsarrayLabels of the issue
Issue numbernumberintegerNumber of the issue
Issue statestatestringState of the issue
Issue titletitlestringTitle of the issue

Get Issue

Get an issue. This can be a pull request or a general issue, and you can tell by the is-pull-request field.

InputIDTypeDescription
Task ID (required)taskstringTASK_GET_ISSUE
Owner (required)ownerstringOwner of the repository
Repository (required)repositorystringRepository name
Issue Number (required)issue-numberintegerNumber of the issue
OutputIDTypeDescription
Issue number (optional)numberintegerNumber of the issue
Issue state (optional)statestringState of the issue
Issue title (optional)titlestringTitle of the issue
Issue body (optional)bodystringBody of the issue
Assignee (optional)assigneestringAssignee of the issue
Assignees (optional)assigneesarray[string]Assignees of the issue
Labels (optional)labelsarray[string]Labels of the issue
Is Pull Request (optional)is-pull-requestbooleanWhether the issue is a pull request

Create Issue

Create an issue

InputIDTypeDescription
Task ID (required)taskstringTASK_CREATE_ISSUE
Owner (required)ownerstringOwner of the repository
Repository (required)repositorystringRepository name
Issue title (required)titlestringTitle of the issue
Issue body (required)bodystringBody of the issue
OutputIDTypeDescription
Issue number (optional)numberintegerNumber of the issue
Issue state (optional)statestringState of the issue
Issue title (optional)titlestringTitle of the issue
Issue body (optional)bodystringBody of the issue
Assignee (optional)assigneestringAssignee of the issue
Assignees (optional)assigneesarray[string]Assignees of the issue
Labels (optional)labelsarray[string]Labels of the issue
Is Pull Request (optional)is-pull-requestbooleanWhether the issue is a pull request

Create Webhook

Create a webhook for a repository

InputIDTypeDescription
Task ID (required)taskstringTASK_CREATE_WEBHOOK
Owner (required)ownerstringOwner of the repository
Repository (required)repositorystringRepository name
Webhook URL (required)hook-urlstringURL to send the payload to
Events (required)eventsarray[string]Events to trigger the webhook. Please see the github document for more information
ActiveactivebooleanWhether the webhook is active. Default is false
Content Typecontent-typestringContent type of the webhook, can be one of: json, form. Default is json
Hook Secrethook-secretstringIf provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers. (see the document)
OutputIDTypeDescription
Webhook ID (optional)idintegerID of the webhook
Webhook URL (optional)urlstringURL of the webhook
Ping URL (optional)ping-urlstringURL to ping the webhook
Test URL (optional)test-urlstringURL to test the webhook
Config (optional)configobjectConfiguration of the webhook
Output Objects in Create Webhook

Config

FieldField IDTypeNote
Content Typecontent-typestringContent type of the webhook
Insecure SSLinsecure-sslstringWhether the webhook is insecure
Webhook URLurlstringURL of the webhook
## Example Recipes

Recipe for the List GitHub Repo Issues pipeline.

version: v1beta
component:
  anthropic-0:
    type: anthropic
    task: TASK_TEXT_GENERATION_CHAT
    input:
      max-new-tokens: 1000
      model-name: claude-3-5-sonnet-20240620
      prompt: Summarise and pick the most important issues from this list ${github.output.issues}
      system-message: You are a helpful assistant.
      temperature: 0.7
      top-k: 10
    setup:
      api-key: ${secret.INSTILL_SECRET}
  github:
    type: github
    task: TASK_LIST_ISSUES
    input:
      direction: desc
      no-pull-request: false
      owner: ${variable.repository-owner}
      page: 1
      per-page: 30
      repository: ${variable.repository-name}
      since: "2021-01-01T00:00:00Z"
      sort: created
      state: open
    setup:
      token: ${secret.github-demo}
variable:
  repository-name:
    title: Repository Name
    description: Name of the repository i.e. instill-core
    instill-format: string
  repository-owner:
    title: Repository Owner
    description: Name of the repository owner i.e. instill-ai
    instill-format: string
output:
  result:
    title: Result
    value: ${anthropic-0.output.text}

# Functions

Init returns an implementation of IConnector that interacts with Slack.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author