Summary: ◀▼
You can connect action flows to GitHub to automate tasks like creating, updating, and commenting on issues and pull requests. Use a dedicated service account for connections and review permissions carefully. Available actions include searching and looking up issues, pull requests, and users, helping you integrate GitHub workflows into your support processes for better collaboration and tracking.
Connecting GitHub to action builder
Before you can include external actions in your action flows, you must connect the action builder to the external system.
- All external actions performed by an action flow are attributed to the user who connected the external system. Therefore, it's a best practice to use a dedicated service account rather than personal credentials when connecting to each external system.
- All integrations request access to necessary scopes. However, it's important that you review and validate the scopes before authorizing the connection to the external system.
- When managing credentials for API key-based tools, such as OpenAI, it's best to store keys in a secure vault or credential manager.
- In Admin Center, click
Apps and integrations in the sidebar, then select Actions > Action
flows. - Create or edit an action flow.
- Open the step sidebar.
- Under External actions, click GitHub.
- Click Connect.
- Follow GitHub's prompts to authenticate and complete the connection.
The GitHub connection uses OAuth 2.0 authentication with the authorization code grant type. When you connect GitHub to action builder, you will be redirected to GitHub to authorize the connection. The connector will receive an access token that allows action flows to perform operations on your behalf.
Review the requested permissions carefully before authorizing the connection. The connector will request access to your repositories, issues, and pull requests based on your account permissions.
Note: All external actions performed by an action flow are attributed to the user who connected the external system. Therefore, it is a best practice to use a dedicated service account rather than personal credentials when connecting to each external system.
After you've connected to the system, you'll see an indicator that it's connected and details about the instance you're connected to, as well as the actions available for GitHub.
Using GitHub actions in action flows
Creating an issue
Use the Create issue action to create a new issue in a GitHub repository.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Owner,
Repository,
TitleOwner is the account owner (user or organization) of the repository. Optional: Assignees and Labels should be comma-separated lists. |
| Output | Issue details including ID, number, URL, state, creation timestamp, and user. |
Updating an issue
Use the Update issue action to update an existing issue's fields or state.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Owner,
Repository,
IssueState can be "open" or "closed." Only provided fields will be updated. Optional: |
| Output | Updated issue details including ID, number, URL, state, and update timestamp. |
Adding a comment to an issue
Use the Add comment to issue action to add a comment to an existing GitHub issue.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Owner,
Repository, Issue,
BodyBody supports GitHub Flavored Markdown formatting. |
| Output | Comment details including ID, URL, creation timestamp, user, and body text. |
Searching for issues
Use the Search issues action to find issues matching search criteria across GitHub repositories.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: QueryOptional: Query uses GitHub search syntax (for example, "repo:owner/repo is:open label:bug"). Sort by options include Best match, Newest, Oldest, Most commented, Least commented, Recently updated, and Least recently updated. Per page maximum is 100, default is 30. |
| Output | Array of issues with total count, containing issue numbers, titles, states, URLs, and timestamps. |
Looking up an issue
Use the Lookup issue action to retrieve complete details for a specific GitHub issue.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Owner,
Repository,
Issue
|
| Output | Complete issue details including ID, number, title, body, state, URL, user, assignees, labels, milestone, comment count, and timestamps. |
Creating a pull request
Use the Create pull request action to create a new pull request in a GitHub repository.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Owner,
Repository, Title,
Head branch, Base
branchHead branch is the branch to merge from, Base branch is the branch to merge into (for example, main). Optional: Draft and Maintainer can modify fields accept true or false values. |
| Output | Pull request details including ID, number, URL, state, draft status, creation timestamp, user, head ref, and base ref. |
Updating a pull request
Use the Update pull request action to update an existing pull request's fields or state.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Owner,
Repository, Pull
requestOptional: State can be "open" or "closed." Only provided fields will be updated. |
| Output | Updated pull request details including ID, number, URL, state, and update timestamp. |
Adding a comment to a pull request
Use the Add comment to pull request action to add a review comment to an existing GitHub pull request.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Owner,
Repository, Pull
request, BodyBody supports GitHub Flavored Markdown formatting. |
| Output | Comment details including ID, URL, creation timestamp, user, and body text. |
Searching for pull requests
Use the Search pull requests action to find pull requests matching search criteria across GitHub repositories.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: QueryOptional: Query uses GitHub search syntax (e.g., "repo:owner/repo is:open"). Sort by options include Best match, Newest, Oldest, Most commented, Least commented, Recently updated, and Least recently updated. Per page maximum is 100, default is 30. |
| Output | Array of pull requests with total count, containing PR numbers, titles, states, URLs, and timestamps. |
Looking up a pull request
Use the Lookup pull request action to retrieve complete details for a specific GitHub pull request.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Owner,
Repository, Pull
request
|
| Output | Complete issue details including ID, number, title, body, state, URL, user, head ref, base ref, draft status, mergeable status, and timestamps. |
Looking up a user
Use the Lookup user action to retrieve GitHub user information by username or email.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Lookup by,
ValueLookup by can be "Username" or "Email." Email search only finds users who have made their email public on GitHub. |
| Output | User details including ID, login, name, email, bio, avatar URL, profile URL, type, and timestamps. |