Github

1. Overview

GitHub is a cloud-based code hosting platform designed for developers to store, manage, track, and collaborate on software projects. It uses Git as its core version control system and provides powerful collaboration features such as issue tracking, code review, continuous integration, and more.

Through GoInsight's Github node, you can seamlessly integrate code repository management and automation operations into your workflows. This enables you to build powerful automation processes around code, issues, releases, and workflows, including:

  • Repository Management: Get detailed repository information, file lists, license information, and search public repositories based on complex conditions.
  • File Operations: Create, read, update, and delete files in specified repositories.
  • Issue Management: Automatically create, edit, get, and lock issues in repositories, and add comments.
  • Release Management: Manage the full lifecycle of repository releases, including creation, retrieval, update, and deletion.
  • Code Review: Create, get, and update review comments for specified pull requests.
  • Workflow Automation: Dispatch, enable, disable, get, and monitor GitHub Actions workflows.
  • Collaboration Management: Invite users to become collaborators on repositories.

2. Prerequisites

Before using this node, you need to meet the following conditions:

  • Have a valid Github account.
  • Create a Personal Access Token (PAT) and grant it the required operation permissions (for example, repo permission for reading and writing private repositories, workflow permission for managing GitHub Actions).

3. Credentials

For a detailed guide on how to obtain and configure credentials, please refer to our official documentation: Credential Configuration Guide.

4. Supported Operations

Summary

The Github node allows you to manage and automate various aspects of your software development lifecycle, including operations on repositories, branches, files, issues, releases, and workflows.

Resource Operation Description
Branch Create a Branch Creates a new branch in the specified GitHub repository.
Branch Delete a Branch Deletes a branch from the specified GitHub repository.
Branch Get a Branch Gets a GitHub branch by its name for a specified repository.
Branch Get Default Branch Gets the default branch of a GitHub repository.
File Create a File Creates a new file in the specified GitHub repository.
File Delete a File Deletes a committed file in a GitHub repository.
File Edit a File Updates the content of an existing file in a GitHub repository.
File Get a File Gets the content of a committed file in a GitHub repository.
File List Files Lists all files in a GitHub repository.
Issue Create an Issue Creates a GitHub issue in the specified repository.
Issue Edit an Issue Updates an existing GitHub issue.
Issue Get an Issue Gets a GitHub issue by its number for a specified repository.
Issue Get Issues of a Repository Gets a list of issues from a specified GitHub repository.
Issue Lock an Issue Locks a specified GitHub issue; this action cannot be undone.
Issue Comment Create an Issue Comment Creates a comment on a GitHub issue.
Pull Request Get Pull Requests of a Repository Gets pull requests of a repository in GitHub.
Release Create a Release Creates a new release in a GitHub repository.
Release Delete a Release Deletes a release in a GitHub repository.
Release Get a Release Gets a GitHub release by its ID for a specified repository.
Release Get a Release by Tag Gets a GitHub release by its tag name for a specified repository.
Release Get Many Releases Gets the list of releases for a specified GitHub repository.
Release Update a Release Updates an existing release in a GitHub repository.
Repository Get a Repository Gets a GitHub repository's information.
Repository Get Repositories for a User Gets the list of repositories for a specified GitHub user.
Repository Get Repositories for an Organization Gets the list of repositories for a specified GitHub organization.
Repository Get the License of a Repository Gets the license information of a GitHub repository specified by owner and repository name.
Repository Get the Profile of a Repository Gets the profile of a GitHub repository specified by the owner and repository name.
Repository List Popular Paths of a Repository Gets the top ten most popular content paths of a GitHub repository based on traffic data.
Repository List the Top Referrers of a Repository Gets the top referrers for a specified GitHub repository.
Repository Search Repository Searches repositories from GitHub.
Review Create a Review Creates a review for a pull request in a GitHub repository.
Review Get a Review Gets a specific review from a GitHub pull request.
Review Get Many Reviews Gets all reviews for a specific pull request in a GitHub repository.
Review Update a Review Update an existing pull request review on GitHub by modifying its comment body and/or review event.
User Invite a User Invites a user to collaborate on a GitHub repository.
Workflow Disable a Workflow Disables a GitHub Actions workflow specified by the repository owner, repository name, and workflow ID or file name.
Workflow Dispatch a Workflow Event Dispatches a GitHub Actions workflow event for a specified workflow, triggering a workflow run on a given git reference.
Workflow Dispatch a Workflow Event Wait Dispatches a GitHub Actions workflow event and waits for its completion.
Workflow Enable a Workflow Enables a specified workflow in a GitHub repository.
Workflow Get a Workflow Retrieves a specific GitHub Actions workflow by its workflow ID from a repository.
Workflow Get the Usage of a Workflow Gets the usage of a GitHub Actions workflow for a specified repository and workflow ID.
Workflow List Workflows Lists all GitHub Actions workflows for a specified repository.

Operation Details

Create a Branch

Creates a new branch in the specified GitHub repository.

Input Parameters:

  • Owner: Repository owner's username.
  • Repo: Repository name.
  • Branch: Name of the new branch to create.
  • Ref: The SHA value of the default branch.

Output:

  • Branch (object): The dictionary of the created branch reference.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description. Empty string when successful.

Create a File

Creates a new file in the specified GitHub repository.

Input Parameters:

  • Owner: The username of the repository owner.
  • Repo: The name of the GitHub repository.
  • FilePath: The path (including filename) where the new file will be created.
  • FileContent: The content of the file to be created; it will be encoded in Base64.
  • CommitMessage: The commit message for creating the file.

Options:

  • Branch: The target branch name; defaults to "main" if not specified.

Output:

  • Created (bool): Indicates whether the file was created successfully.
  • FileSha (string): The SHA value of the created file (if successful), empty string otherwise.
  • StatusCode (number): The HTTP response code (-1 for parameter errors, 500 for internal errors).
  • ErrorMessage (string): Error message if any error occurs; empty string on success.

Create a Release

Creates a new release in a GitHub repository.

Input Parameters:

  • Owner: The owner of the GitHub repository.
  • Repo: The name of the GitHub repository.
  • TagName: The tag name for the release.

Options:

  • ReleaseName: The name of the release (default: empty string).
  • Body: The description text for the release (default: empty string).
  • Draft: Whether to create a draft release (default: false).
  • Prerelease: Whether to create a prerelease (default: false).

Output:

  • Release (object): The dictionary of the created release.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description if any, empty string if successful.

Create a Review

Creates a review for a pull request in a GitHub repository.

Input Parameters:

  • Owner: The repository owner's username.
  • Repo: The repository name.
  • PullNumber: The number of the pull request to review.
  • Body: The content of the review.
  • Event: The review event type, one of "APPROVE", "REQUEST_CHANGES", or "COMMENT".

Output:

  • Review (object): The dictionary of the created review object.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): The error message if any error occurs; empty on success.

Create an Issue

Creates a GitHub issue in the specified repository.

Input Parameters:

  • Owner: The repository owner's username.
  • Repo: Repository identifier in the format 'repo'.
  • Title: Title of the issue to be created.

Options:

  • Body: Content of the issue, which is optional.

Output:

  • Issue (object): A JSON formatted object representing the created issue details.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Describes any error encountered, or is empty if successful.

Create an Issue Comment

Creates a comment on a GitHub issue.

Input Parameters:

  • Owner: The username of the repository owner.
  • Repo: The repository name.
  • IssueNumber: The identifier of the issue to comment on.
  • CommentBody: The content of the comment.

Output:

  • Comment (object): The dictionary representation of the comment.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if any, empty if no error.

Delete a Branch

Deletes a branch from the specified GitHub repository.

Input Parameters:

  • Owner: Repository owner's username.
  • Repo: Repository name.
  • Branch: Name of the branch to delete.

Output:

  • Deleted (bool): Whether the deletion was successful.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description. Empty string when successful.

Delete a File

Deletes a committed file in a GitHub repository.

Input Parameters:

  • Owner: The username or organization name owning the repository.
  • Repo: The name of the repository.
  • FilePath: The file path within the repository to be deleted.
  • CommitMessage: The commit message for the deletion operation.

Options:

  • Branch: Branch name, default is empty, if empty, the default branch 'main' is used.

Output:

  • Deleted (bool): Indicates whether the file was successfully deleted.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description if any error occurred; empty string if no error.

Delete a Release

Deletes a release in a GitHub repository.

Input Parameters:

  • Owner: The username or organization that owns the repository.
  • Repo: The name of the repository.
  • ReleaseId: The ID of the release to delete.

Output:

  • Deleted (bool): Indicates whether the release was successfully deleted.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if any occurred, empty on success.

Disable a Workflow

Disables a GitHub Actions workflow specified by the repository owner, repository name, and workflow ID or file name.

Input Parameters:

  • Owner: The GitHub user or organization that owns the repository.
  • Repo: The name of the repository.
  • Workflow: The ID (numeric) or file name of the workflow to disable.

Output:

  • Disabled (bool): Indicates whether the specified workflow was successfully disabled.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if validation or request fails, empty otherwise.

Dispatch a Workflow Event

Dispatches a GitHub Actions workflow event for a specified workflow, triggering a workflow run on a given git reference.

Input Parameters:

  • Owner: The GitHub username or organization that owns the repository.
  • Repo: The name of the repository.
  • Workflow: The file name or ID of the workflow to dispatch.
  • Ref: The git reference (branch, tag) on which to run the workflow.

Options:

  • Inputs: A JSON object of input parameters for the workflow.

Output:

  • Dispatched (bool): Indicates whether the workflow dispatch request succeeded.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error details if the dispatch failed, empty if successful.

Dispatch a Workflow Event Wait

Dispatches a GitHub Actions workflow event and waits for its completion.

Input Parameters:

  • Owner: The owner of the repository.
  • Repo: The name of the repository.
  • Workflow: The filename or ID of the GitHub Actions workflow.
  • Ref: The git reference (branch or tag) to use for the dispatch event.

Output:

  • RunId (number): The ID of the triggered workflow run.
  • Status (string): The status of the workflow run (completed)
  • Conclusion (string): The conclusion of the workflow run (success, failure, etc.).
  • HtmlUrl (string): The URL to view the workflow run on GitHub.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if the operation failed, empty otherwise.

Edit a File

Updates the content of an existing file in a GitHub repository.

Input Parameters:

  • Owner: The owner of the repository (username or organization name).
  • Repo: The repository name.
  • FilePath: The file path within the repository to be updated.
  • CommitMessage: The commit message for the update.
  • NewContent: The new file content (will be base64 encoded).

Options:

  • Branch: The branch where the file exists (default is the main branch).

Output:

  • Updated (bool): Indicates whether the file was successfully updated.
  • CommitSha (string): The SHA of the commit that updated the file.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message in case of failure, empty if successful.

Edit an Issue

Updates an existing GitHub issue.

Input Parameters:

  • Owner: The owner of the repository (username or organization).
  • Repo: Repository name.
  • IssueNumber: The issue number to be edited.
  • Title: The new title for the issue.

Options:

  • Body: The new content for the issue, optional.

Output:

  • Issue (object): JSON formatted dict containing the updated issue data.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if any, empty otherwise.

Enable a Workflow

Enables a specified workflow in a GitHub repository.

Input Parameters:

  • Owner: The repository owner's name.
  • Repo: The repository name.
  • Workflow: The ID or file name of the workflow to enable (e.g., ci.yml).

Output:

  • Enabled (bool): Indicates whether the workflow was successfully enabled.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if enabling failed or parameter validation error.

Get Default Branch

Gets the default branch of a GitHub repository.

Input Parameters:

  • Owner: Repository owner's username.
  • Repo: Repository name.

Output:

  • Branch (object): Default branch information.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description. Empty string when successful.

Get Issues of a Repository

Gets a list of issues from a specified GitHub repository.

Input Parameters:

  • Owner: The owner of the GitHub repository.
  • Repo: The name of the GitHub repository.

Output:

  • Issues (object-array): Issues list in JSON list format.
  • Total (number): Total number of issues.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if the request fails or parameter validation error occurs; empty if successful.

Get Many Releases

Gets the list of releases for a specified GitHub repository.

Input Parameters:

  • Owner: The username or organization name that owns the repository.
  • Repo: The name of the repository.

Output:

  • Releases (object-array): A JSON string list of GitHub release objects.
  • Total (number): Total number of releases.
  • StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
  • ErrorMessage (string): Error description if any, empty string on success.

Get Many Reviews

Gets all reviews for a specific pull request in a GitHub repository.

Input Parameters:

  • Owner: Repository owner's username.
  • Repo: Repository name.
  • PullNumber: The pull request number to retrieve reviews for.

Output:

  • Reviews (object-array): JSON string representing the list of review objects returned by GitHub API.
  • Total (number): Total number of reviews.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description if any, empty on success.

Get Pull Requests of a Repository

Gets pull requests of a repository in GitHub.

Input Parameters:

  • Owner: The GitHub username or organization name that owns the repository.
  • Repo: The name of the repository to retrieve pull requests from.

Options:

  • State: An state of pull request.
  • Sort: a sort order of pull request
  • Direction: A sort direction
  • PerPage: The number of results returned per page
  • Page: page number

Output:

  • PullRequests (object-array): A JSON string list of pull request objects returned by the GitHub API.
  • Total (number): Total number of pull requests.
  • StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
  • ErrorMessage (string): Error message if parameter validation fails or API request fails, empty otherwise。

Get Repositories for a User

Gets the list of repositories for a specified GitHub user.

Input Parameters:

  • UserName: The GitHub username whose repositories are to be fetched.

Output:

  • Repositories (object-array): A JSON string representing the list of repositories.
  • Total (number): Total number of repositories.
  • StatusCode (number): HTTP status code: 201 for success, other codes for error, -1 for parameter validation failure.
  • ErrorMessage (string): Empty if no error, otherwise contains error description.

Get Repositories for an Organization

Gets the list of repositories for a specified GitHub organization.

Input Parameters:

  • Organization: The GitHub organization name whose repositories you want to retrieve.

Output:

  • Repositories (object-array): A JSON string of the list of repository objects returned by GitHub API.
  • Total (number): Total number of repositories.
  • StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
  • ErrorMessage (string): Error message if the operation fails, empty when successful.

Get a Branch

Gets a GitHub branch by its name for a specified repository.

Input Parameters:

  • Owner: Repository owner's username.
  • Repo: Repository name.
  • Branch: Name of the branch to get.

Output:

  • Branch (object): Retrieved Branch object in dict format.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description. Empty string when successful.

Get a File

Gets the content of a committed file in a GitHub repository.

Input Parameters:

  • Owner: Owner of the GitHub repository (username or organization).
  • Repo: Name of the GitHub repository.
  • FilePath: File path within the repository.

Options:

  • Refer: Optional commit sha, branch name, or tag to specify the version of the file. If empty, the default branch is used.

Output:

  • FileContent (string): The decoded content of the file fetched from GitHub.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error details if any error occurs, otherwise empty.

Get a Release

Gets a GitHub release by its ID for a specified repository.

Input Parameters:

  • Owner: The owner of the repository.
  • Repo: The name of the repository.
  • ReleaseId: The ID of the release to retrieve.

Output:

  • Release (object): JSON string of the retrieved GitHub release object.
  • StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
  • ErrorMessage (string): Empty if no errors; otherwise the error message.

Get a Release by Tag

Gets a GitHub release by its tag name for a specified repository.

Input Parameters:

  • Owner: Repository owner's username.
  • Repo: Repository username.
  • TagName: Tag name for the release.

Output:

  • Release (object): Retrieved Release object in dict format.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description. Empty string when successful.

Get a Repository

Gets a GitHub repository's information.

Input Parameters:

  • Owner: The GitHub username or organization name owning the repository.
  • Repo: The name of the repository.

Output:

  • Repository (object): A dictionary containing the repository information.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if any; empty if successful.

Get a Review

Gets a specific review from a GitHub pull request.

Input Parameters:

  • Owner: The repository owner's GitHub username.
  • Repo: The repository name.
  • PullNumber: The pull request number
  • ReviewId: The review ID to retrieve.

Output:

  • Review (object): JSON object of the retrieved review object.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if any, empty when successful.

Get a Workflow

Retrieves a specific GitHub Actions workflow by its workflow ID from a repository.

Input Parameters:

  • Owner: The repository owner's username.
  • Repo: The repository name.
  • Workflow: The ID or file name of the GitHub Actions workflow to retrieve.

Output:

  • Workflow (object): the GitHub Actions workflow to retrieve
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if any; empty string if successful.

Get an Issue

Gets a GitHub issue by its number for a specified repository.

Input Parameters:

  • Owner: The repository owner's username.
  • Repo: The repository name.
  • IssueNumber: The number of the issue to retrieve.

Output:

  • Issue (object): Issue details in JSON format.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description if any; empty when successful.

Get the License of a Repository

Gets the license information of a GitHub repository specified by owner and repository name.

Input Parameters:

  • Owner: The owner of the repository.
  • Repo: The name of the repository.

Output:

  • License (object): License information JSON dictionary (including key, name, spdx_id, url, node_id).
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description if any, empty otherwise.

Get the Profile of a Repository

Gets the profile of a GitHub repository specified by the owner and repository name.

Input Parameters:

  • Owner: The username of the repository owner.
  • Repo: The name of the repository.

Output:

  • Profile (object): A JSON string representing the repository profile.
  • StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
  • ErrorMessage (string): Error message if any; empty on success.

Get the Usage of a Workflow

Gets the usage of a GitHub Actions workflow for a specified repository and workflow ID.

Input Parameters:

  • Owner: The owner of the repository.
  • Repo: The name of the repository.
  • Workflow: The ID or file name of the workflow to retrieve usage for.

Output:

  • Usage (object): JSON format dictionary representation of the workflow usage data returned by GitHub API.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if the API request or parameter validation fails, empty otherwise.

Invite a User

Invites a user to collaborate on a GitHub repository.

Input Parameters:

  • Owner: The username of the repository owner.
  • Repo: The name of the repository.
  • UserName: The GitHub username to invite as a collaborator.

Options:

  • Permission: The permission to grant: pull, push, admin, maintain, triage. Defaults to repository default if omitted.

Output:

  • InvitationSent (bool): Indicates whether the invitation was successfully created.
  • AlreadyCollaborator (bool): Indicates whether the user is already a collaborator.
  • InvitationDetails (object): Details of the invitation object, returned when InvitationSent is True, otherwise empty.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if any; empty string on success.

List Files

Lists all files in a GitHub repository.

Input Parameters:

  • Owner: Owner of the GitHub repository (username or organization).
  • Repo: Name of the GitHub repository.
  • Branch: The branch name to list files from.

Output:

  • FileList (string-array): JSON list, each element in the list is a file path (only items with type blob are included).
  • Total (number): Total number of files.
  • StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
  • ErrorMessage (string): Error message if any, empty if successful.

List Popular Paths of a Repository

Gets the top ten most popular content paths of a GitHub repository based on traffic data.

Input Parameters:

  • Owner: The username of the repository owner.
  • Repo: The name of the repository.

Output:

  • PopularPaths (object-array): A JSON string representing a list of popular paths.
  • Total (number): Total number of popular paths.
  • StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
  • ErrorMessage (string): Error description, empty if no error.

List Workflows

Lists all GitHub Actions workflows for a specified repository.

Input Parameters:

  • Owner: The owner (username or organization) of the GitHub repository.
  • Repo: The name of the GitHub repository.

Output:

  • Workflows (object-array): Workflows list in JSON list format, each element is a workflow object.
  • Total (number): Total number of workflows.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description if any; empty on success.

List the Top Referrers of a Repository

Gets the top referrers for a specified GitHub repository.

Input Parameters:

  • Owner: The GitHub username or organization name that owns the repository.
  • Repo: The name of the repository.

Output:

  • TopReferrers (object-array): JSON-formatted list of referrer objects
  • Total (number): Total number of referrers.
  • StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
  • ErrorMessage (string): Error message if any; empty if the request succeeded.

Lock an Issue

Locks a specified GitHub issue; this action cannot be undone.

Input Parameters:

  • Owner: The GitHub user or organization that owns the repository.
  • Repo: The name of the repository.
  • IssueNumber: The number of the issue to lock.

Output:

  • Locked (bool): Indicates whether the issue was successfully locked.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error description if any, empty string otherwise.

Search Repository

Searches repositories from GitHub.

Options:

  • Query: Search query string, e.g. 'tetris language:assembly'.
  • Sort: Sort field. Options: 'stars', 'forks', 'help-wanted-issues', 'updated'. Default is best match.
  • Order: Sort order. Options: 'desc', 'asc'. Default: 'desc'.
  • Perpage: Number of results per page (1-100). Default: 10.
  • Page: Page number, starting from 1. Default: 1.

Output:

  • Repositories (object-array): Repository list, each repository is a JSON object (dictionary).
  • Total (number): Total count of search results.
  • Incompleted (bool): Indicates whether the search timed out.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message, empty string on success.

Update a Release

Updates an existing release in a GitHub repository.

Input Parameters:

  • Owner: Owner of the repository.
  • Repo: Name of the repository.
  • ReleaseId: The ID of the release to update.

Options:

  • TagName: New tag name for the release.
  • TargetCommitish: Specifies the commitish value that determines where the Git tag is created from.
  • Name: Name of the release.
  • Body: Description text of the release.
  • Draft: True to mark the release as a draft.
  • PreRelease: to mark the release as a prerelease.

Output:

  • Release (object): A dictionary containing the updated release information.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if update failed, empty if successful.

Update a Review

Update an existing pull request review on GitHub by modifying its comment body and/or review event.

Input Parameters:

  • Owner: Repository owner (user or organization) name.
  • Repo: Repository name.
  • PullNumber: Pull request number to which the review belongs.
  • ReviewId: The ID of the review to update.

Options:

  • Body: New review comment content. If omitted or empty, event must be provided.
  • Event: Review event action. One of APPROVE, REQUEST_CHANGES, or COMMENT. If omitted or empty, body must be provided.

Output:

  • Review (object): Updated Review object.
  • StatusCode (number): HTTP status code or operation status code (-1 for parameter error, 500 for exceptions).
  • ErrorMessage (string): Error message if any; empty string when operation succeeds.

5. Example Usage

This section will guide you through creating a simple workflow to automatically create a new Issue in your GitHub repository.

Workflow Overview

A basic workflow contains three nodes: Start -> Create an Issue -> Answer. When the workflow is triggered, it will create a new Issue in your specified repository.

Step-by-Step Guide

  1. Add Tool Node:
    • In the workflow canvas, click the "+" button to add a new node.
    • Select the "Tools" tab in the panel that appears.
    • Find and select Github from the tools list.
    • In the list of operations supported by Github, click to select Create an Issue, which will add the corresponding node to the canvas.
  2. Configure Node:
    • Click the newly added Create an Issue node, and the configuration panel for this node will expand on the right.
    • Credential Configuration: At the top of the panel, find the credentials field. Click the dropdown menu and select your configured Github credentials.
    • Parameter Entry: Fill in the input parameters for this operation in detail.
    • Owner: Fill in the name of the user or organization that owns the target repository. For example, go-insight.
    • Repo: Fill in the name of the target repository. For example, go-insight-public.
    • Title: Enter a title for the Issue you want to create. For example, Fix Bug on Login Page.
    • Body (optional): You can add a more detailed description for the Issue. For example, User receives no response after clicking the login button..
  3. Run and Verify:
    • When all required parameters are filled in correctly, the error prompt in the upper right corner of the workflow canvas will disappear.
    • Click the "Test Run" button in the upper right corner of the canvas to execute the workflow.
    • After successful execution, you can click the log icon in the upper right corner to view the detailed input and output of the node. The Issue field in the output will contain detailed information about the newly created Issue. You can also visit your GitHub repository to confirm whether the new Issue has been successfully created.

Final Workflow Display

After completing the above steps, your entire workflow will be configured. After clicking "Test Run", a new Issue will be successfully created in your specified GitHub repository.

6. FAQs

Q: Why am I receiving a 403 Forbidden or 404 Not Found error when operating on private repositories?

A: This is usually due to insufficient permissions. Please check the following:

  • Credential Permissions: Ensure that the Personal Access Token (PAT) you use for GoInsight credentials has sufficient permission scopes. For reading and writing private repositories, you typically need the repo scope.
  • Repository Access: Confirm that your GitHub account itself has the appropriate permissions (for example, write permissions) for the target repository.

Q: What format should the SearchQuery parameter be in when using the "Search Repository" operation?

A: The SearchQuery parameter uses GitHub's official search syntax. You can combine multiple keywords and qualifiers for precise searching. For example, to search for repositories containing the keyword "goinsight" that use the Go language and have more than 100 stars, you can fill in: goinsight language:go stars:>100.

Q: Do I need to perform Base64 encoding myself for the FileContent in the "Create a File" operation?

A: No. You only need to provide the original text content in the FileContent field. The GoInsight node will automatically perform Base64 encoding for you when sending the request to the GitHub API.

7. Official Documentation

For more advanced usage and detailed information about the GitHub API, please refer to the official documentation:

Github REST API Official Documentation

Was This Page Helpful?
Discussion

Leave a Reply.

Your email address will not be published. Required fields are marked*

loading...
No Results