logo

NJP

Linking A Studio App to GitHub

Import · Jan 10, 2022 · article

Here's an example of using Studio's source control integration to track your ServiceNow application development via GitHub.

Create Credential

You will need to add a credential to your ServiceNow instance so it can perform actions in your GitHub repositories. If you have already done so, you can skip this step; it is not required that Studio have its own credential.

Add an SSH key to your GitHub account, as in https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account.

In your ServiceNow instance:

  • go to Connections & Credentials->Credentials
  • Click "New"
  • Select "SSH Private Key Credentials"
  • Populate the following fields:
  • "Name" - assign a meaningful name
  • "SSH Private Key" - must contain the private key contents corresponding to the key you created/added to GitHub above

image

Create GitHub Repository

In your GitHub account:

  • Navigate to the Repositories page. Click "New" and provide a meaningful Repository name.
  • Select Public or Private as applicable.
  • Click Create repository.

image

  • After clicking "Create repository", ensure that "SSH" is selected in the "Quick setup" section. Copy the SSH URL into your clipboard.image

Link to Source Control

In your ServiceNow instance:

  • Navigate to your scoped application in Studio. Select "Source Control"->"Link to Source Control".
  • Populate the resulting dialog box as follows:
  • * Network protocol: select "ssh:
    • URL: paste the URL from GitHub here
    • Branch: generally the default is good here; if you have an alternate branch naming you want to use, update as applicable
    • MID Server Name: if you are segregating MID server usage, select a MID with access to GitHub here
    • Credential: select the credential you added above
  • Click "Link to Source Control"

image

  • Verify the operation is successful; if you do not see success, it is usually helpful to set MID logging to the maximum and retry the operation. Common issues are network connectivity or GitHub permissions.

Labels:

image

View original source

https://www.servicenow.com/community/developer-articles/linking-a-studio-app-to-github/ta-p/2323512