This custom action needs to be added at step level in a job to register artifact details in ServiceNow instance.
- credentials (Devops integration token of a GitHub tool created in ServiceNow DevOps or username and password for a ServiceNow devops integration user)
- instance URL for your ServiceNow dev, test, prod, etc. environments
- tool_id of your GitHub tool created in ServiceNow DevOps
On GitHub, go in your organization settings or repository settings, click on the Secrets > Actions and create a new secret.
For token based authentication which is available from v2.0.0, create secrets called
SN_INSTANCE_URLyour ServiceNow instance URL, for example https://test.service-now.comSN_ORCHESTRATION_TOOL_IDonly the sys_id is required for the GitHub tool created in your ServiceNow instanceSN_DEVOPS_INTEGRATION_TOKENrequired for token based authentication
For basic authentication , create secrets called
SN_INSTANCE_URLyour ServiceNow instance URL, for example https://test.service-now.comSN_ORCHESTRATION_TOOL_IDonly the sys_id is required for the GitHub tool created in your ServiceNow instanceSN_DEVOPS_USERSN_DEVOPS_PASSWORD
registerartifact:
name: Register Artifact
runs-on: ubuntu-latest
steps:
- name: ServiceNow Register Artifact
uses: ServiceNow/servicenow-devops-register-artifact@v3.1.0
with:
devops-integration-token: ${{ secrets.SN_DEVOPS_INTEGRATION_TOKEN }}
instance-url: ${{ secrets.SN_INSTANCE_URL }}
tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }}
context-github: ${{ toJSON(github) }}
job-name: 'Register Artifact'
artifacts: '[{"name": "com:customactiondemo","version": "1.${{ github.run_number }}","semanticVersion": "1.${{ github.run_number }}.0","repositoryName": "${{ github.repository }}"}]'registerartifact:
name: Register Artifact
runs-on: ubuntu-latest
steps:
- name: ServiceNow Register Artifact
uses: ServiceNow/servicenow-devops-register-artifact@v3.1.0
with:
devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }}
devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }}
instance-url: ${{ secrets.SN_INSTANCE_URL }}
tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }}
context-github: ${{ toJSON(github) }}
job-name: 'Register Artifact'
artifacts: '[{"name": "com:customactiondemo","version": "1.${{ github.run_number }}","semanticVersion": "1.${{ github.run_number }}.0","repositoryName": "${{ github.repository }}"}]'The values for secrets should be setup in Step 1. Secrets should be created in Step 2.
Optional DevOps Integration Username to ServiceNow instance.
Optional DevOps Integration User Password to ServiceNow instance.
Optional DevOps Integration Token of GitHub tool created in ServiceNow instance for token based authentication.
Required URL of ServiceNow instance to register artifact details.
Required Orchestration Tool Id for GitHub created in ServiceNow DevOps
Required Github context contains information about the workflow run details.
Required Display name of the job given for attribute name in which steps have been added for this custom action. For example, if display name of job is Register Artifact then job-name value must be 'Register Artifact'
Required The list of artifacts to be registered in ServiceNow instance. Each artifact is a JSON object surrounded by curly braces {} containing key-value pair separated by a comma ,. A key-value pair consists of a key and a value separated by a colon :. The keys supported in key-value pair are name, version, semanticVersion, repositoryName key-value pair separated by comma surrounded by curly braces {}. For example, '[{"name": "com:firstrepo","version": "1.${{ github.run_number }}","semanticVersion": "1.${{ github.run_number }}.0","repositoryName": "${{ github.repository }}"}]'
No outputs produced.
ServiceNow customers may request support through the Now Support (HI) portal.
This action supports routing all HTTP/HTTPS traffic through a corporate proxy server. The action automatically detects proxy configuration from the following environment variables (checked in order):
| Environment Variable | Description |
|---|---|
HTTPS_PROXY |
Proxy URL for HTTPS requests (recommended) |
https_proxy |
Lowercase alternative for HTTPS proxy |
HTTP_PROXY |
Proxy URL for HTTP requests |
http_proxy |
Lowercase alternative for HTTP proxy |
Set any of these environment variables in your workflow to enable proxy support. The proxy URL format is:
http://<host>:<port>
http://<username>:<password>@<host>:<port>
jobs:
registerArtifact:
name: ServiceNow Register Artifact
runs-on: ubuntu-latest
env:
HTTPS_PROXY: ${{ secrets.HTTPS_PROXY_URL }}
steps:
- name: ServiceNow Register Artifact
uses: ServiceNow/servicenow-devops-register-artifact@v6.x
with:
devops-integration-token: ${{ secrets.SN_DEVOPS_INTEGRATION_TOKEN }}
instance-url: ${{ secrets.SN_INSTANCE_URL }}
tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }}
context-github: ${{ toJSON(github) }}
job-name: 'ServiceNow Register Artifact'
artifacts: '[{"name":"app.jar","version":"1.0.0","repositoryName":"my-repo"}]'Note: The proxy must support HTTP CONNECT tunneling for HTTPS traffic. If the
HTTPS_PROXY(or any of the above) environment variable is not set, the action connects directly without a proxy.
Initially, ServiceNow product management and engineering representatives will own governance of these integrations to ensure consistency with roadmap direction. In the longer term, we hope that contributors from customers and our community developers will help to guide prioritization and maintenance of these integrations. At that point, this governance model can be updated to reflect a broader pool of contributors and maintainers.