GitHub Spoke
Manage distributed version control and source code in GitHub from your ServiceNow instance. Create flows in ServiceNow to manage collaborative features such as tracking bugs, feature requests, tasks and so on, for projects in GitHub. View and analyze meaningful usage data for GitHub Enterprise Cloud and GitHub Enterprise Server software subscriptions so that you can reclaim stale licenses.
Request apps on the Store
Visit the ServiceNow Store to view all the available apps, and for information about submitting requests to the store. For cumulative release notes information for all released apps, see the ServiceNow Store version history release notes.
Integration Hub subscription
This spoke requires an Integration Hub subscription. For more information, see Legal schedules - IntegrationHub overview.
Spoke version
GitHub spoke v3.5.1 is the latest version.
Supported versions
This spoke was built for GitHub API version v3, but may be compatible with later versions.
Spoke requirements
- GitHub account
- User with admin credentials
- Token to authenticate the ServiceNow instance
GitHub Webhooks module
Bi-directional webhooks can be set up to be notified about the required events. Routing policy defines conditions that must be met to notify the ServiceNow app. These conditions are based on the events in GitHub for which you want to be notified about. When the conditions are met, the routing policy triggers the associated subflow, which in turn automates the GitHub tasks.
- GitHub Webhook Registries
- GitHub WebHook Routing Policies
| Supported GitHub fields | ||
|---|---|---|
| Action | Project Card Creator | Ref |
| Base Ref | Project Card Note | Ref Type |
| Commit Comment Body | Project Card Previous Note | Release Assets |
| Commit Comment Created At | Project Card Updated At | Release Author |
| Commit Comment Path | Project Column Created At | Release Body |
| Commit Comment Updated At | Project Column Name | Release Created At |
| Commit Comment User | Project Column Previous Name | Release Draft |
| Force Push | Project Column Updated At | Release Name |
| GitHub Instance URL | Project Created At | Release Published At |
| Issue Assigned To | Project Name | Release Tag Name |
| Issue Assignees | Project Previous Body | Release Target Commits |
| Issue Body | Project Previous Name | Repository Archived |
| Issue Closed At | Project State | Repository Created At |
| Issue Comment | Project Updated At | Repository Description |
| Issue Comment Count | Pull Request Assigned To | Repository inactive |
| Issue Comment Created At | Pull Request Assignees | Repository Full Name |
| Issue Comment Updated At | Pull Request Body | Repository Has Issues |
| Issue Created At | Pull Request Closed At | Repository Has Projects |
| Issue Labeled To | Pull Request Comment Count | Repository Import Status |
| Issue Labels | Pull Request Created At | Repository License |
| Issue Locked | Pull Request Draft | Repository Open Issues Count |
| Issue Milestone | Pull Request Labeled To | Repository Owner |
| Issue Previous Body | Pull Request Labels | Repository Private |
| Issue Previous Comment | Pull Request Locked | Repository Pushed At |
| Issue Previous Milestone | Pull Request Mergeable | Repository Starred At |
| Issue Previous Title | Pull Request Merged | Repository Updated At |
| Issue Previously Assigned To | Pull Request Merged At | Repository Vulnerability Alert Affected Range |
| Issue Previously Labeled To | Pull Request Milestone | Repository Vulnerability Alert External Identifier |
| Issue State | Pull Request Previous Body | Repository Vulnerability Alert Fixed In |
| Issue Title | Pull Request Previous Title | Repository Vulnerability Alert Package Name |
| Issue Updated At | Pull Request Previously Assigned To | Security Advisory Description |
| Issue User | Pull Request Previously Labeled To | Security Advisory ID |
| Milestone Closed At | Pull Request Rebaseable | Security Advisory Published At |
| Milestone Created At | Pull Request Review Body | Security Advisory Severity |
| Milestone Creator | Pull Request Review Comment | Security Advisory Summary |
| Milestone Description | Pull Request Review Comment Count | Security Advisory Updated At |
| Milestone Due On | Pull Request Review Comment Created At | Security Advisory Withdrawn At |
| Milestone State | Pull Request Review Comment File Path | Sender login |
| Milestone Title | Pull Request Review Comment Previous Comment | Status Commit Message |
| Milestone Updated At | Pull Request Review Comment Updated At | Status Context |
| Organization Description | Pull Request Review Previous Body | Status Created At |
| Organization Login | Pull Request Review State | Status Description |
| Pre-Release | Pull Request State | Status Name |
| Project Body | Pull Request Title | Status State |
| Project Card Archived | Pull Request Updated At | Status Updated At |
| Project Card Created At | Pull Request User | Webhook Event |
To use other conditions in the routing policy, create a routing policy in the GitHub WebHook Routing Policies module and specify conditions according to your requirement. See Set up bi-directional webhook for the GitHub spoke for information regarding setting up and configuring the webhooks.
Spoke triggers
ServiceNow supports specific events on GitHub that create triggers. You must first configure a flow with a supported trigger definition. When an event, for example, a push request, occurs on the GitHub, it sends the payload via a webhook to the ServiceNow instance. After that, the flow that you configured is triggered at the ServiceNow instance to automate a workflow. The supported events are:
| Category | Trigger | Description |
|---|---|---|
| Branch Management | Branch Created | Flow is triggered when you create a branch on GitHub. |
| Repository Management | Pull Request Opened | Flow is triggered when you initiate a new pull request on GitHub. |
| Pull Request Edited | Flow is triggered when you update a pull request on GitHub. | |
| Pull Request Closed | Flow is triggered when you close a pull request on GitHub. | |
| Pull Request Assigned | Flow is triggered when you assign a pull request to a user on GitHub. | |
| Pull Request Reopened | Flow is triggered when you reopen a pull request on GitHub. | |
| Repository Fork | Flow is triggered when you fork a repository on GitHub. | |
| Repository Push | Flow is triggered when you push to a repository on GitHub. | |
| Release Management | Release Created | Flow is triggered when the details of a release are created on GitHub. |
| Release Edited | Flow is triggered when the details of a release are updated on GitHub. | |
| Release Deleted | Flow is triggered when a release is removed on GitHub. | |
| Release Released | Flow is triggered when a release is released on GitHub. |
For information about setting up the triggers for the GitHub spoke, see Activate the trigger definition on ServiceNow instance. For more information about inbound integration, see Conditional and event-driven inbound integration.
Spoke subflows
| Subflow | Description | Supported GitHub Event |
|---|---|---|
| Process GitHub Branch and Tag Webhook Events | Handles branch and tag webhook events. | Branch and Tag |
| Process GitHub Commit Webhook Events | Handles commit webhook events. | Commit |
| Process GitHub Issue Webhook Events | Handles issue webhook events. | Issue |
| Process GitHub Milestone Webhook Events | Handles milestone webhook events. | Milestone |
| Process GitHub Project Webhook Events | Handles project webhook events. | Project |
| Process GitHub Pull Request Webhook Events | Handles pull request webhook events. | Pull Request |
| Process GitHub Push Webhook Events | Handles push request webhook events. | Push Request |
| Process GitHub Release Webhook Events | Handles release webhook events. | Release |
| Process GitHub Repository Webhook Events | Handles repository webhook events. | Repository |
| Process GitHub Security Webhook Events | Handles security webhook events. | Security |
| Process GitHub Webhook Events | Handles all GitHub webhook events. |
주:
This subflow handles all GitHub events. You can customize this subflow to handle other GitHub webhook events that are not supported by default. |
To create subflows to handle other GitHub webhook events or handle the supported GitHub webhook events differently, customize the Process GitHub Webhook Events subflow. For this, you must a create a copy of the subflow, parse the payload, and customize the subflow according to your requirement. Payload is one of the inputs to the subflow.
While customizing subflows, you must confirm that the subflows are configured to avoid infinite loops.
- You must configure webhooks to use the spoke subflow. See Set up bi-directional webhook for the GitHub spoke for information regarding setting up and configuring the webhook.
- The sample subflows run as a user by default. It can be configured to run as a system.
- GitHub spoke supports application/json payload. Configure the GitHub webhook accordingly. See the GitHub Developer documentation for instructions on creating and configuring a webhook.
Spoke actions
The GitHub spoke provides actions manage branches, issues, repositories, and source code when events occur in ServiceNow. Available actions include:
| Category | Action | Description |
|---|---|---|
| Branch Management | Create Branch | Creates a branch in GitHub based on a specific commit SHA. |
| Delete Branch | Deletes a branch from the GitHub repository. | |
| Look up Branch | Retrieves the details of a branch in the GitHub repository. | |
| Look up Branch Protection | Retrieves the restriction details of the required branch. | |
| Look up Branches | Retrieves the list of all branches in a repository. | |
| Remove Branch Protection | Removes protection on the required branch. | |
| Update Branch Protection | Updates protection on the required branch. | |
| Issue Management | Create Comment on Issue | Creates comment on a required issue. |
| Create Issue | Creates issue for the required repository. | |
| Delete Comment on Issue | Deletes comment on a required issue. | |
| Lock Issue | Locks the required issue. This limits the conversation to collaborators only. | |
| Look Up Comments on Issue Stream | Retrieves the list of comments on an issue. | |
| Look Up Issues Stream | Retrieves the list of issues for a repository. | |
| Unlock Issue | Unlocks the required issue. This opens conversation to all users. | |
| Update Comment on Issue | Updates a comment on an issue. | |
| Update Issue | Updates the details of the required issue. | |
| Metadata Retrieval | Look up Fields by Action | Retrieves the list of fields for an action filter in the GitHub Fields table. |
| Look up Branches Metadata | Retrieves metadata of the branches. | |
| Look up Issues Metadata | Retrieves metadata of the issues. | |
| Look up Milestones Metadata | Retrieves metadata of the milestones. | |
| Look up Pull Requests Metadata | Retrieves metadata of the pull requests. | |
| Organization Management | Look up Organization Plan | Retrieves the plan name of an organization. |
| Look up Organization Members Stream | Retrieves the list of all members within an organization. | |
| Look up Organization Repositories Stream | Retrieves the list of all repositories within an organization. | |
| Remove Organization Member | Removes a user from an organization. | |
| Look up Organization Events Stream | Retrieves the list of events in an organization based on the provided look back date. | |
| Look up Organization Outside Collaborators Stream | Retrieves the list of all Outside Collaborators within an organization. | |
| Remove Organization Outside Collaborator | Removes an outside collaborator from an organization. | |
| Look up Organization Pending Outside Collaborators Stream | Retrieves a list of pending collaborators within a repository. | |
| Look up Organization Invitations Stream | Retrieves a list of invitations within an organization. | |
| Look up Organization Audit Log Stream | Retrieves a list of organization audit log events for a specified look-back date. | |
| Repository Management | Add Collaborator | Adds collaborator to the required repository. |
| Delete Repository | Deletes a repository from GitHub. | |
| Create Comment on Pull Request | Create review comments on a pull request. | |
| Create Milestone | Creates milestone for the required repository. | |
| Create Pull Request | Creates a pull request for a repository. | |
| Create Reply on Pull Request Review Comment | Creates reply to a review comment for a pull request. | |
| Create Repository | Creates a repository in GitHub. | |
| Delete Comment on Pull Request | Deletes review comment on a pull request. | |
| Delete Milestone | Deletes milestone from the required repository. | |
| Look up Comments on Pull Request Stream | Retrieves the list of all review comments on a pull request. | |
| Look up Milestones Stream | Retrieves the list of all milestones in a repository. | |
| Look up Repository Events Stream | Retrieves the list of events across a repository. | |
| Look Up Pull Requests Stream | Retrieves the details of pull requests for a repository. | |
| Look Up Repositories Stream | Retrieves the details of repositories based on a specific user or organization. | |
| Look up Repository Details | Retrieves the details of the specified repository. | |
| Merge Pull Request | Merges the pull request to a repository. | |
| Remove Collaborator | Removes collaborator from a repository. | |
| Update Comment on Pull Request | Updates review comments provided for a pull request. | |
| Update Milestone | Updates the details of a milestone in a repository. | |
| Update Pull Request | Updates the details of a pull request in a repository. | |
| Update Repository | Updates the details of a repository in GitHub. | |
| Source Code Management | Create Comment on Commit | Creates a comment for the required commit using its SHA. |
| Create or update a file | Creates a file or updates an existing file in a repository. | |
| Look up Comments by Commit ID Stream | Retrieves comments provided for a single commit. | |
| Look up Commit Information By ID | Retrieves the contents of the required commit reference. | |
| Look up File Content | Retrieves the contents of a file in a repository. 주: This action supports
files with file size up to 1 MB. |
|
| Look up Commits on a Repository | Retrieves the details of all commits made on a repository. | |
| User Management | Look up All Users for Enterprise Server | Retrieves the list of all GitHub Enterprise Server users. |
| Look up Organizations for the Authenticated User Stream | Retrieves the list of organizations that the logged-in user is a member of. | |
| Suspend User | Suspends a GitHub user account. | |
| Look up Authenticated User | Retrieves information about the authenticated user. |
Available AI agents
Install Now Assist for Integration Hub and start using the available AI agents. For more information, see Now Assist for Integration Hub.
- In the ServiceNow agentic system, you can create an agentic workflow that comprises of a set of large language model (LLM) instructions along with one or more standalone AI agents to execute an
objective. See Create an agentic workflow for information about adding AI agents to create agentic workflows as per your requirement and provide the required trigger.
You can also search for other available AI agents and add them to your agentic workflow. See Find AI agents for more information.
- You can create a clone of the required spoke AI agent and customize it as per your requirement. See Duplicate an AI agent for more information about creating a clone.
- See Now Assist AI agents for information about AI agents.
Available AI agents include:
| AI agent | Description |
|---|---|
| GitHub branch management AI agent | Manages and maintains the GitHub branches. Also, retrieves information about the GitHub branches. |
| GitHub issue management AI agent | Manages and automates GitHub-related tasks in Integration Hub. |
| GitHub repository management AI agent | Manages the GitHub repositories by handling the repository operations, pull requests, comments on pull request and milestones. |
| GitHub source code management AI agent | Manages source code and handles the repository files, commits, and comments. |
| GitHub Code Automation AI Agent | Manages code changes and GitHub operations from your ServiceNow instance. This agent interprets your requests, asks clarifying questions, and analyzes context to deliver well-integrated code updates. It also performs GitHub tasks such as creating branches, committing changes, and opening pull requests. |
There might be AI agents installed with the Now Assist application that are not used in agentic workflows. To learn how to see all agents that are available to you, see Find AI agents.
Spoke modules
| Module | Description |
|---|---|
| GitHub Owner | Displays the GitHub owner records that you had created. |
| GitHub Repositories | Displays the details of the GitHub repositories associated with the GitHub owners. |
Connection and credential alias requirements
Integration Hub uses aliases to manage connection and credential information, and OAuth credentials. Using an alias eliminates the need to configure multiple credentials and connection information profiles when using multiple environments. If the connection or credential information changes, you don't need to update any actions that use the connection.
For information about setting up the spoke, see Set up the GitHub spoke.