Update Change Workflow #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
# Runs a single command using the runners shell | |
- name: Run a one-line script | |
run: echo Hello, world! | |
# Runs a set of commands using the runners shell | |
- name: Run a multi-line script | |
run: | | |
echo Add other actions to build, | |
echo test, and deploy your project. | |
test: | |
needs: build | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
# Runs a single command using the runners shell | |
- name: Run a one-line script | |
run: echo Hello, world! | |
# Runs a set of commands using the runners shell | |
- name: Run a multi-line script | |
run: | | |
echo Add other actions to build, | |
echo test, and deploy your project. | |
ServiceNowDevOpsChange: | |
# jobs that must complete successfully before this job will run | |
needs: test | |
# type of machine to run the job on | |
runs-on: ubuntu-latest | |
name: 'ServiceNow DevOps Change' | |
steps: | |
- name: ServiceNow Change | |
uses: ServiceNow/[email protected] | |
with: | |
# Devops Integration Token | |
devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN }} | |
# ServiceNow Instance URL | |
instance-url: ${{ secrets.SN_INSTANCE_URL }} | |
# Orchestration Tool Id | |
tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }} | |
# GitHub Context | |
context-github: ${{ toJSON(github) }} | |
# Display Name of the Job | |
job-name: 'ServiceNow DevOps Change' | |
change-request: '{"setCloseCode":"true","attributes":{"short_description":"Automated Software Deployment Change Request","description":"Automated Software Deployment Change Request, Created via DevOps Change Velocity & GitHub Integration.","implementation_plan":"Software update is tested and results can be found in Test Summaries Tab; When the change is approved the implementation happens automated by the CICD pipeline within the change planned start and end time window.","backout_plan":"When software fails in production, the previous software release will be re-deployed.","test_plan":"Testing if the software was successfully deployed"}}' | |
# You can specify the requested_by attribute either with name or sys_id. Example: "requested_by":{"name": "Test User"} or "requested_by": "62826bf03710200044e0bfc8bcbe5df1" | |
# You can specify the assignment_group attribute either with name or sys_id. Example: "assignment_group":{"name": "Change Approval Team"} or "assignment_group": "5f721d93c0a8010e015533746de18bf9" | |
# start_date: This is the planned start date | |
# end_date: This is the planned end date |