GitHub

App · Code Repositories · 17 actions · 7 triggers

Manage GitHub branches, issues, and pull requests with a personal access token.

Triggers

Start a workflow when something happens in GitHub. See how triggers work.

New pull request

Runs when a pull request is opened in a GitHub repository.

Filters

Narrow which events start a run.

ownerRequired
repoRequired
base

Event fields

What a run starts with. Later steps read each field with an @ reference.

numbernumber
titletext
statetext
html_urltext
headtext
basetext
drafttrue/false
usertext
created_attext
updated_attext

Updated pull request

Runs when a pull request in a GitHub repository is updated.

Filters

Narrow which events start a run.

ownerRequired
repoRequired
base

Event fields

What a run starts with. Later steps read each field with an @ reference.

numbernumber
titletext
statetext
html_urltext
headtext
basetext
drafttrue/false
usertext
created_attext
updated_attext

New issue

Runs when an issue is opened in a GitHub repository.

Filters

Narrow which events start a run.

ownerRequired
repoRequired
label

Event fields

What a run starts with. Later steps read each field with an @ reference.

numbernumber
titletext
statetext
html_urltext
bodytext
usertext
labelslist
assigneeslist
created_attext
updated_attext

Updated issue

Runs when an issue in a GitHub repository is updated.

Filters

Narrow which events start a run.

ownerRequired
repoRequired
label

Event fields

What a run starts with. Later steps read each field with an @ reference.

numbernumber
titletext
statetext
html_urltext
bodytext
usertext
labelslist
assigneeslist
created_attext
updated_attext

New push to branch

Runs for each new commit pushed to a branch of a GitHub repository.

Filters

Narrow which events start a run.

ownerRequired
repoRequired
branch

Event fields

What a run starts with. Later steps read each field with an @ reference.

shatext
messagetext
authortext
branchtext
html_urltext
committed_attext

New release

Runs when a release is created in a GitHub repository.

Filters

Narrow which events start a run.

ownerRequired
repoRequired

Event fields

What a run starts with. Later steps read each field with an @ reference.

idnumber
tag_nametext
nametext
bodytext
drafttrue/false
prereleasetrue/false
html_urltext
authortext
published_attext

New review request

Runs when someone is asked to review a pull request in a GitHub repository.

Filters

Narrow which events start a run.

ownerRequired
repoRequired
reviewer

Event fields

What a run starts with. Later steps read each field with an @ reference.

numbernumber
titletext
statetext
html_urltext
headtext
basetext
drafttrue/false
usertext
created_attext
updated_attext
reviewertext

Actions

ActionWhat it does
Add label to issueAdd one or more labels to an issue, keeping the labels it already has.
Close pull requestClose a pull request without merging it.
Create branchCreate a new branch in a repository.
Create commentAdd a comment to an issue or pull request.
Create issueCreate a new issue in a repository.
Create pull requestOpen a new pull request to merge one branch into another.
Delete branchDelete a branch from a repository.
Delete issuePermanently delete an issue.
Get branchGet details of a specific branch, including its latest commit SHA.
Get issueGet details of a specific issue.
Get organizationGet the public profile details of a GitHub organization.
Get pull requestGet details of a specific pull request.
Get userGet the public profile details of a GitHub user.
Lock issueLock an issue's conversation so only repository collaborators can comment on it.
Remove label from issueRemove one label from an issue, leaving its other labels alone.
Unlock issueUnlock an issue's conversation so anyone can comment again.
Update issueUpdate an existing issue.

Add label to issue

Add one or more labels to an issue, keeping the labels it already has.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Issueissue_numbernumberRequired
The open issue to act on.
LabelslabelstextRequired
The labels to add. Pick one, or enter several separated by commas.

Outputs

addedlist
issue_numbernumber
labelslist
Example output
{
  "added": [
    "bug"
  ],
  "issue_number": 42,
  "labels": [
    "bug",
    "needs-triage"
  ]
}

Close pull request

Close a pull request without merging it. GitHub does not allow pull requests to be deleted, so closing is the way to shut one down.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Pull requestpull_numbernumberRequired
The open pull request to act on.

Outputs

html_urltext
idnumber
numbernumber
statetext
titletext
Example output
{
  "base": "main",
  "draft": false,
  "head": "feature/new-widget",
  "html_url": "https://github.com/octocat/hello-world/pull/7",
  "id": 111,
  "merged": false,
  "number": 7,
  "state": "closed",
  "title": "Add new widget"
}

Create branch

Create a new branch in a repository. Points the new branch at the tip of an existing branch (defaults to the repository's default branch) unless you supply a specific commit SHA.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
New branch namebranchtextRequired
The name for the new branch (without the 'refs/heads/' prefix).
Source branchfrom_branchtext
The existing branch to base the new one on. Defaults to the repository's default branch when not set.
Source commit SHAshatext
A specific commit SHA to point the new branch at. Takes precedence over the source branch when provided.

Outputs

nametext
reftext
shatext
Example output
{
  "name": "feature/new-widget",
  "ref": "refs/heads/feature/new-widget",
  "sha": "aa218f56b14c9653891f9e74264a383fa43fefbd"
}

Create comment

Add a comment to an issue or pull request. Use the issue or pull request number, since both share the same numbering.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Issueissue_numbernumberRequired
The open issue to comment on. To comment on a pull request, reference its number from an earlier step.
CommentbodytextRequired
The text of the comment.

Outputs

bodytext
html_urltext
idnumber
userobject
Example output
{
  "body": "This is a comment.",
  "html_url": "https://github.com/octocat/hello-world/issues/42#issuecomment-456",
  "id": 456,
  "user": {
    "login": "commenter"
  }
}

Create issue

Create a new issue in a repository.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
TitletitletextRequired
The title of the new issue.
Descriptionbodytext
The main text of the issue.
Labelslabelslist
Labels to add to the issue.
Assigneesassigneeslist
The people to assign to the issue.

Outputs

html_urltext
idnumber
numbernumber
statetext
titletext
Example output
{
  "html_url": "https://github.com/octocat/hello-world/issues/43",
  "id": 123,
  "number": 43,
  "state": "open",
  "title": "New Feature Request"
}

Create pull request

Open a new pull request to merge one branch into another.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
TitletitletextRequired
The title of the pull request.
Source branch (head)headtextRequired
The branch with your changes that you want to merge in. For a cross-fork request, reference a 'username:branch' value from an earlier step.
Target branch (base)basetextRequired
The branch you want your changes merged into.
Descriptionbodytext
The main text describing the pull request.
Create as draftdrafttrue/false
Open the pull request as a draft that isn't ready to merge.Default: false.

Outputs

basetext
drafttrue/false
headtext
html_urltext
idnumber
mergedtrue/false
numbernumber
statetext
titletext
Example output
{
  "base": "main",
  "draft": false,
  "head": "feature/new-widget",
  "html_url": "https://github.com/octocat/hello-world/pull/7",
  "id": 111,
  "merged": false,
  "number": 7,
  "state": "open",
  "title": "Add new widget"
}

Delete branch

Delete a branch from a repository.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Branch namebranchtextRequired
The name of the branch to delete (without the 'refs/heads/' prefix).

Outputs

branchtext
deletedtrue/false
Example output
{
  "branch": "feature/old-widget",
  "deleted": true
}

Delete issue

Permanently delete an issue. GitHub only allows this through its GraphQL API, and the connected account must be able to delete issues in the repository (an organization owner, or a repository admin or maintainer).

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Issueissue_numbernumberRequired
The open issue to delete.

Outputs

deletedtrue/false
issue_numbernumber
Example output
{
  "deleted": true,
  "issue_number": 42
}

Get branch

Get details of a specific branch, including its latest commit SHA.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Branch namebranchtextRequired
The name of the branch to look up.

Outputs

html_urltext
nametext
protectedtrue/false
shatext
Example output
{
  "html_url": "https://github.com/octocat/hello-world/tree/main",
  "name": "main",
  "protected": true,
  "sha": "aa218f56b14c9653891f9e74264a383fa43fefbd"
}

Get issue

Get details of a specific issue.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Issueissue_numbernumberRequired
The open issue to look up.

Outputs

bodytext
html_urltext
idnumber
numbernumber
statetext
titletext
Example output
{
  "body": "Description of the bug.",
  "html_url": "https://github.com/octocat/hello-world/issues/42",
  "id": 789,
  "number": 42,
  "state": "open",
  "title": "Bug in feature X"
}

Get organization

Get the public profile details of a GitHub organization.

Inputs

OrganizationorgtextRequired
The login (short name) of the organization.

Outputs

descriptiontext
html_urltext
idnumber
logintext
nametext
public_reposnumber
Example output
{
  "description": "How people build software.",
  "html_url": "https://github.com/github",
  "id": 9919,
  "login": "github",
  "name": "GitHub",
  "public_repos": 484
}

Get pull request

Get details of a specific pull request.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Pull requestpull_numbernumberRequired
The open pull request to act on.

Outputs

basetext
bodytext
drafttrue/false
headtext
html_urltext
idnumber
mergedtrue/false
numbernumber
statetext
titletext
Example output
{
  "base": "main",
  "body": "This pull request adds the new widget.",
  "draft": false,
  "head": "feature/new-widget",
  "html_url": "https://github.com/octocat/hello-world/pull/7",
  "id": 111,
  "merged": false,
  "number": 7,
  "state": "open",
  "title": "Add new widget"
}

Get user

Get the public profile details of a GitHub user. Leave the username blank to fetch the account the token belongs to.

Inputs

Usernameusernametext
The GitHub username to look up. Leave blank for the connected (authenticated) account.

Outputs

html_urltext
idnumber
logintext
nametext
public_reposnumber
typetext
Example output
{
  "html_url": "https://github.com/octocat",
  "id": 583231,
  "login": "octocat",
  "name": "The Octocat",
  "public_repos": 8,
  "type": "User"
}

Lock issue

Lock an issue's conversation so only repository collaborators can comment on it.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Issueissue_numbernumberRequired
The open issue to act on.
Reasonlock_reasontext
Why the conversation is being locked. Optional.One of: off-topic (Off topic), too heated, resolved, spam.

Outputs

issue_numbernumber
lock_reasontext
lockedtrue/false
Example output
{
  "issue_number": 42,
  "lock_reason": "resolved",
  "locked": true
}

Remove label from issue

Remove one label from an issue, leaving its other labels alone.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Issueissue_numbernumberRequired
The open issue to act on.
LabellabeltextRequired
The label to remove from the issue.

Outputs

issue_numbernumber
labelslist
removedtext
Example output
{
  "issue_number": 42,
  "labels": [
    "bug"
  ],
  "removed": "needs-triage"
}

Unlock issue

Unlock an issue's conversation so anyone can comment again.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Issueissue_numbernumberRequired
The open issue to act on.

Outputs

issue_numbernumber
lockedtrue/false
Example output
{
  "issue_number": 42,
  "locked": false
}

Update issue

Update an existing issue. Only the fields you fill in are changed. Labels and assignees replace the issue's current lists; use 'Add label to issue' / 'Remove label from issue' to change one label at a time.

Inputs

Repository ownerownertextRequired
The username or organization that owns the repository (the part before the '/' in 'owner/repo').
Repository namerepotextRequired
The name of the repository (the part after the '/' in 'owner/repo').
Issueissue_numbernumberRequired
The open issue to act on.
Titletitletext
A new title for the issue. Leave blank to keep the current one.
Descriptionbodytext
A new description for the issue. Leave blank to keep the current one.
Statestatetext
Reopen or close the issue. Leave blank to keep its current state.One of: open, closed.
Labelslabelslist
The complete set of labels the issue should end up with. Leave blank to keep its current labels.
Assigneesassigneeslist
The complete set of assignees the issue should end up with. Leave blank to keep its current assignees.

Outputs

assigneeslist
bodytext
html_urltext
idnumber
labelslist
lockedtrue/false
numbernumber
statetext
titletext
Example output
{
  "assignees": [
    "octocat"
  ],
  "body": "The widget stops responding after a resize.",
  "html_url": "https://github.com/octocat/hello-world/issues/42",
  "id": 1001,
  "labels": [
    "bug"
  ],
  "locked": false,
  "number": 42,
  "state": "open",
  "title": "Fix the widget"
}

On this page