GitHub connector
Overview
Section titled “Overview”The built-in GitHub connector provides actions for repositories, issues, pull requests, commits, files, and workflow runs. It also includes repository event triggers. Connector availability can vary by environment.
Add a GitHub operation
Section titled “Add a GitHub operation”- Open a workflow in the designer and add a trigger or action.
- Find GitHub in the connector picker and choose the operation you need.
- Select or create a connection.
- Select the repository owner and repository, then complete the operation’s required fields.
- Review the workflow and test it with a repository and data you’re authorized to use.
Actions
Section titled “Actions”| Area | Supported actions |
|---|---|
| Repositories and commits | Get a repository; list branches, tags, collaborators, and commits; get a commit; list check runs for a Git reference; get combined commit status; and create a commit status. |
| Files and Git objects | Get repository content; create or update file contents; delete a file; create and get blobs, commit objects, and trees; and get, create, update, or delete Git references. |
| Issues | List, create, get, and update issues; list and create comments; list assignees and repository labels; and add or remove labels. |
| Pull requests | List, create, get, update, and merge pull requests; list changed files; request reviewers; create a review comment; create and submit reviews; and update a pull request branch. |
| Workflow runs and releases | Get a workflow run, list runs for a workflow, and create a release. |
List actions return a page of results. Where the action exposes page and per_page, increase page to retrieve subsequent pages and use per_page to set the page size. page defaults to 1; per_page defaults to 30 or 100 depending on the action. Available parameters vary by action.
Issues
Section titled “Issues”| Action | What it does |
|---|---|
| List repository issues | Retrieve issues for a repository. GitHub’s issues API can also return pull requests. |
| Create an issue | Open an issue in a repository. |
| Get issue | Retrieve an issue by number. |
| Update an issue | Change an existing issue, including its open or closed state. |
| List issue comments | Retrieve comments on an issue or pull request. |
| Create an issue comment | Add a comment to an issue or pull request. |
| List assignees | List users who can be assigned to issues in a repository. |
| List labels for a repository | Retrieve the repository’s available labels. |
| Add labels to an issue | Apply labels to an issue. |
| Remove a label from an issue | Remove a specific label from an issue. |
For example, start with an issue event trigger and check that its action is opened. Then use Get issue to inspect the issue and Add labels to an issue or Create an issue comment to record the result. Checking the action prevents a label added by the workflow from being processed as another opened issue.
Triggers
Section titled “Triggers”| Trigger | Events |
|---|---|
| When an issue event occurs | Issue events, such as an issue being opened, edited, closed, reopened, or labeled. |
| When an issue comment event occurs | Issue comment events, such as a comment being created, edited, or deleted on an issue or pull request. |
| When a pull request event occurs | Pull request events, such as a pull request being opened, closed, reopened, synchronized, or labeled. |
| When code is pushed | Commits are pushed to a branch or tag. |
| When a check suite is requested, rerequested, or completed | Check suite events, such as a suite being requested, rerequested, or completed. |
| When a deployment status changes | A deployment’s status changes. |
| When a label event occurs | Label events, such as a repository label being created, edited, or deleted. |
| When a milestone event occurs | Milestone events, such as a milestone being created, edited, closed, opened, or deleted. |
| When a repository star is added or removed | Star events, such as a repository gaining or losing a star. |
| When the repository is forked | A fork is created. |
| When a discussion event occurs | A discussion is created, edited, answered, or otherwise changed. |
| When a commit comment is created | Commit comment events, such as a comment being created on a commit. |
These triggers subscribe to the GitHub event type, not a subset of its actions. Where the payload includes action, check it in a condition before processing the event. In particular, issue and pull request events include actions beyond the examples above, and a workflow’s own changes can trigger another run.
The deployment status trigger responds to status changes rather than a specific status. Use the returned status in a later condition to branch on a particular outcome.
GitHub Enterprise variant
Section titled “GitHub Enterprise variant”An environment-specific GitHub Enterprise variant uses the same actions and triggers against its configured host. It requires explicit enablement and isn’t registered by default. Its presence doesn’t imply support for arbitrary GitHub Enterprise Server URLs; use only the variant and host offered by your environment.
For connection setup, permissions, and common issues, see shared connector guidance.