GitHub

Verified against Flow 5.0.0-beta.39

View as Markdown
On this page

The GitHub category has 24 tasks. Each entry shows the task's latest revision, the one the palette adds. See Reading an entry.

Add Issue to Project

Adds a GitHub issue to a GitHub Issue Project

  • Slug: add-issue-to-project
  • Type: template
  • Revision: 2
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Project ID projectId Text Yes The unique Node ID
Issue ID issueId Text Yes Unique Node ID

No results.

Comment on GitHub Issue or Pull Request

Adds a comment to an issue or a pull request, which share one numbering. Works with a GitHub App installation token (Issues: write, or Pull requests: write for a pull request) or a personal access token. See https://docs.github.com/en/rest/issues/comments#create-an-issue-comment

  • Slug: comment-on-github-issue
  • Type: template
  • Revision: 1
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Owner owner Text Yes The organization or user that owns the repository
Repository repo Text Yes The repository name, without the owner
Issue or Pull Request Number number Text Yes
Comment body Text Area Yes The comment text, in Markdown

Results

Name Description
commentId The comment's ID
commentUrl The comment's web URL

Create GitHub Issue

Opens an issue in a repository. Works with a GitHub App installation token (Issues: write) or a personal access token. See https://docs.github.com/en/rest/issues/issues#create-an-issue

  • Slug: create-github-issue
  • Type: template
  • Revision: 1
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Owner owner Text Yes The organization or user that owns the repository
Repository repo Text Yes The repository name, without the owner
Title title Text Yes
Body body Text Area No The issue text, in Markdown
Labels labels Text No Label names, comma- or newline-separated. GitHub drops labels, assignees and milestone silently without push access
Assignees assignees Text No Logins, comma- or newline-separated
Milestone milestone Text No The milestone number

Results

Name Description
issueNumber The new issue's number
issueUrl The issue's web URL
issueId The issue's ID

Example

Open an issue when a nightly check fails, with the token the workspace's GitHub integration shares. See Create an issue from a workflow.

Field Value
Task name open-issue
URL Leave $(workspace.params.github-url)
Github Access Token Leave $(workspace.params.github-token)
Owner my-org
Repository website
Title Nightly check failed
Body The nightly check failed in run $(context.params.workflowrun-ref).
Labels bug,nightly

The task returns:

Result Value
issueNumber The new issue's number, such as 42
issueUrl Its web address, such as https://github.com/my-org/website/issues/42
issueId GitHub's numeric ID for the issue

Link open-issue from the check with a failure link, so it runs only when the check fails. A later task can post $(tasks.open-issue.results.issueUrl).

Common problems

Symptom Cause Fix
The task fails before it runs, with no such workspace param 'github-token' The workspace doesn't share the GitHub token. The editor warns about it when you save. Share the token: see Share the installation token with tasks. Or enter a personal access token in Github Access Token.
The task fails with GitHub createIssue failed: HTTP 404: Not Found Owner or Repository is wrong, or the token can't see the repository: GitHub answers 404 for a private repository it hides from you. Check both fields, and that the GitHub App is installed on the repository.
The task fails with GitHub createIssue failed: HTTP 410: Issues are disabled for this repo The repository has issues turned off, as a fork does by default. Turn on issues in the repository's settings on GitHub.
The issue is created without its labels or assignees GitHub drops labels, assignees and milestone, without an error, when the token has no push access to the repository. Use a token that can write to the repository.

Create GitHub Pull Request

Opens a pull request from one branch into another. Works with a GitHub App installation token (Pull requests: write) or a personal access token. See https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request

  • Slug: create-github-pull-request
  • Type: template
  • Revision: 1
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Owner owner Text Yes The organization or user that owns the repository
Repository repo Text Yes The repository name, without the owner
Title title Text Yes
Head Branch head Text Yes The branch with the changes; owner:branch for a branch in a fork
Base Branch base Text Yes The branch to merge into, e.g. main
Body body Text Area No The description, in Markdown
Draft draft Boolean No false Open the pull request as a draft

Results

Name Description
pullRequestNumber The new pull request's number
pullRequestUrl The pull request's web URL

Create GitHub Release

Creates a release, and its tag when the tag does not exist yet. Works with a GitHub App installation token (Contents: write) or a personal access token. See https://docs.github.com/en/rest/releases/releases#create-a-release

  • Slug: create-github-release
  • Type: template
  • Revision: 1
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Owner owner Text Yes The organization or user that owns the repository
Repository repo Text Yes The repository name, without the owner
Tag tagName Text Yes The release's tag, e.g. v1.2.0
Target targetCommitish Text No The branch or commit SHA a new tag is created from. Blank is the default branch
Name name Text No The release title. Blank uses the tag
Notes body Text Area No The release notes, in Markdown
Draft draft Boolean No false
Pre-release prerelease Boolean No false
Generate Release Notes generateReleaseNotes Boolean No false Have GitHub write the notes from the merged pull requests, after any notes given
Make Latest makeLatest Select No Whether this becomes the latest release. Blank is GitHub's default, true

Results

Name Description
releaseId The release's ID
releaseUrl The release's web URL

Create Team in Organization

Creates a Github team in the organization identified by the organizationName parameter. For further reading on the underlying API see https://docs.github.com/en/rest/reference/teams#create-a-team

  • Slug: create-team-in-organization
  • Type: template
  • Revision: 4
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Organization Name organizationName Text Yes
Team Name teamName Text Yes
Team Description description Text Area No
Maintainers maintainers Text No List of IDs for org members to become maintainers
Repository Names repositoryNames Text No The full name of repositories to add the team to
Level of privacy privacy Select No Level of privacy this team should have
Repository team's default permissions permission Select No
The ID of a team to set as the parent team parentTeamId Text No
Response File Path outputFilePath Text No File path to store the output response

Results

Name Description
team The newly created team

Delete Team from Organization

Deletes a Github team from a Github organization based on the teamName parameter. For further reading on the underlying API see https://docs.github.com/rest/reference/teams/#delete-a-team

  • Slug: delete-team-from-organization
  • Type: template
  • Revision: 2
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Organization Name organizationName Text Yes
Team Name teamName Text Yes

No results.

Dispatch GitHub Workflow

Triggers a GitHub Actions workflow that has a workflow_dispatch trigger. Works with a GitHub App installation token (Actions: write) or a personal access token. See https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event

  • Slug: dispatch-github-workflow
  • Type: template
  • Revision: 1
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Owner owner Text Yes The organization or user that owns the repository
Repository repo Text Yes The repository name, without the owner
Workflow workflow Text Yes The workflow's file name (e.g. deploy.yml) or numeric ID
Ref ref Text Yes The branch or tag to run the workflow on
Inputs inputs json No A JSON object of the workflow's inputs, e.g. {"environment": "staging"}

Results

Name Description
runId The workflow run's ID, when the server reports it (github.com does); empty otherwise
runUrl The workflow run's web URL, when the server reports it; empty otherwise

Find Issues and Label

Finds issues in a repository based on time since last activity and adds a label and a comment. This is useful for marking issues inactive or reminding users to update an issue.

  • Slug: find-issues-and-label
  • Type: template
  • Revision: 4
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
API Endpoint url URL Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
API Token token Secured No $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Owner org Text No Owner or Organization
Repository repo Text No
Days Since Activity daysSinceActivity Number No 30
Label label Text No Label to add to issue
Ignore Label ignoreLabel Text No ignore Issues with this label will be ignored

No results.

Find Issues and Remove

Finds github issues and removes with optional days since activity and labels

  • Slug: find-issues-and-remove
  • Type: template
  • Revision: 3
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
API Endpoint url URL No $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
API Token token Secured No $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Owner org Text No Owner or Organization
Repository repo Text No
Days Since Activity daysSinceActivity Number No
Issue Label label Text No A label to filter the issues by

No results.

Find Repositories in Org

Find Repositories in a GitHub organization

  • Slug: find-repositories-in-org
  • Type: template
  • Revision: 4
  • Image: Default task image.

Warning

Revision 1 does nothing and ends succeeded: the command it calls is no longer in the task image. Later revisions work. Upgrade a node pinned to revision 1 in the editor. See Some older task revisions do nothing.

Parameters

Label Name Type Required Default Helper text
URL url Text No $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Token token Secured No $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Org org Text No
Visibility visibility Select No all
Repositories to Skip skipRepos Text Area No
Number of Repositories to Retrieve numToRetrieve Number No
Response File Path outputFilePath Text No File path to store the output response

Results

Name Description
repositories Filtered repositories list
repositoriesPrettyPrint Filtered list based repositories

Get All Organizations

Lists all Github organizations, in the order that they were created on GitHub. For further reading on the underlying API see https://docs.github.com/rest/reference/orgs/#list-organizations

  • Slug: get-all-organizations
  • Type: template
  • Revision: 2
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
First organization ID since Text No
Number of organizations maxNoOrg Number No The maximum returned number of organizations

Results

Name Description
organizations List of the organizations

Get All Teams in Organization

Lists all teams in an organization that are visible to the authenticated token. For further reading on the underlying API see https://docs.github.com/en/rest/reference/teams#list-teams

  • Slug: get-all-teams-in-organization
  • Type: template
  • Revision: 3
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Organization Name organizationName Text Yes
Page Number pageNumber Number No
Number of teams per page teamsPerPage Number No
Response File Path outputFilePath Text No File path to store the output response

Results

Name Description
teams List of teams in the organization

Get GitHub File Contents

Reads one file from a repository at a branch, tag or commit. Works with a GitHub App installation token (Contents: read) or a personal access token. See https://docs.github.com/en/rest/repos/contents#get-repository-content

  • Slug: get-github-file-contents
  • Type: template
  • Revision: 1
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Owner owner Text Yes The organization or user that owns the repository
Repository repo Text Yes The repository name, without the owner
File Path path Text Yes The file's path in the repository, e.g. config/app.yaml
Ref ref Text No The branch, tag or commit SHA. Blank is the default branch
Output File outputFile Text No A workspace path to write the file to, absolute or relative to /workspace. Needed for a file over 3000 bytes or one that is not UTF-8 text

Results

Name Description
content The file's text, when it is UTF-8 and fits in a result (3000 bytes); otherwise empty and the file is in Output File
sha The file's blob SHA
size The file's size in bytes
outputPath The absolute path of Output File, when set

Get Github Repository

Get the Gihub repository details based on the Github URL. For further reading on the underlying API see https://docs.github.com/en/rest/reference/repos#get-a-repository

  • Slug: get-github-repository
  • Type: template
  • Revision: 3
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Repository URL repoURL Text Yes The Github repository url to get the details for
Response File Path outputFilePath Text No File path to store the output response

Results

Name Description
result Github repository details

Get Organization Info

Retrieves the details of a Github organization. For further reading on the underlying API see https://docs.github.com/en/rest/reference/orgs#get-an-organization

  • Slug: get-organization-info
  • Type: template
  • Revision: 3
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Organization Name organizationName Text Yes
Response File Path outputFilePath Text No File path to store the output response

Results

Name Description
organization Github organization details

Get Team In Organization

Retrieves the details of a team from a Github organization given the team name. For further reading on the underlying API see https://docs.github.com/en/rest/reference/teams#list-teams

  • Slug: get-team-in-organization
  • Type: template
  • Revision: 3
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Organization Name organizationName Text Yes
Team Name teamName Text Yes
Response File Path outputFilePath Text No File path to store the output response

Results

Name Description
team Github team details

Invite Collaborator to Project

Invites a Github user identified vie email to collaborate to a repository. For further reading on the underlying API see https://docs.github.com/en/rest/reference/repos#add-a-repository-collaborator

  • Slug: invite-collaborator-to-project
  • Type: template
  • Revision: 2
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Repository URL repoURL Text Yes The Github repository url to add the collaborator
Collaborator Email Address userEmail Text Yes
Permission permission Select No The permission to grant the collaborator

No results.

Invite Member to Team

Invite a Github member to be a team member in the organization. For further reading on the underlying API see https://docs.github.com/en/rest/reference/teams#add-or-update-team-membership-for-a-user

  • Slug: invite-member-to-team
  • Type: template
  • Revision: 3
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Organization Name organizationName Text Yes
Team Name teamName Text Yes
User Email Address userEmail Text Yes
User Role role Select No The role that this user should have in the team
Response File Path outputFilePath Text No File path to store the output response

Results

Name Description
result Result containing the url, role and state of the action

Invite User to Organization

Invite an User to the member list of a Github organization. For further reading on the underlying API see https://docs.github.com/en/rest/reference/orgs#set-organization-membership-for-a-user

  • Slug: invite-user-to-organization
  • Type: template
  • Revision: 3
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Organization Name organizationName Text Yes
User Email Address userEmail Text Yes
User Role role Select No The role to give the user in the organization
Response File Path outputFilePath Text No File path to store the output response

Results

Name Description
result Result containing the details and outcome of the action

Make Repositories Private

Make Repositories Private.

  • Slug: make-repositories-private
  • Type: template
  • Revision: 2
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text No $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Token token Secured No $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Org org Text No
Repositories repos Text Area No

No results.

Remove Collaborator From Project

Removes a Github Collaborator from a repository. For further reading on the underlying API see https://docs.github.com/en/rest/reference/repos#remove-a-repository-collaborator

  • Slug: remove-collaborator-from-project
  • Type: template
  • Revision: 2
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Repository URL repoURL Text Yes The Github repository url from where to remove
Collaborator Email Address userEmail Text Yes

No results.

Remove Member from Team

Remove a member from a team within the organization. For further reading on the underlying API see https://docs.github.com/en/rest/reference/teams#remove-team-membership-for-a-user

  • Slug: remove-member-from-team
  • Type: template
  • Revision: 2
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Organization Name organizationName Text Yes
Team Name teamName Text Yes
User Email Address userEmail Text Yes

No results.

Set GitHub Commit Status

Sets a commit status (the check shown on a commit and its pull requests). Works with a GitHub App installation token (Commit statuses: write) or a personal access token. See https://docs.github.com/en/rest/commits/statuses#create-a-commit-status

  • Slug: set-github-commit-status
  • Type: template
  • Revision: 1
  • Image: Default task image.

Parameters

Label Name Type Required Default Helper text
URL url Text Yes $(workspace.params.github-url) Defaults to the GitHub API URL the workspace's GitHub integration shares
Github Access Token token Secured Yes $(workspace.params.github-token) Defaults to the token the workspace's GitHub integration shares; or enter a personal access token
Owner owner Text Yes The organization or user that owns the repository
Repository repo Text Yes The repository name, without the owner
Commit SHA sha Text Yes
State state Select Yes
Context context Text No The status's name, e.g. flow/build. Blank is GitHub's 'default'; each context is its own status
Target URL targetUrl Text No Where the status links, e.g. the Flow run
Description description Text No A short summary; GitHub takes 140 characters, so a longer one is shortened

Results

Name Description
statusId The status's ID