GitHub Actions Integration
Integrate ServiceNow with GitHub Actions workflows for automated change management and compliance
Overview
This guide demonstrates how to integrate ServiceNow change management with GitHub Actions workflows. The integration enables automated change request creation, approval gates, and deployment tracking directly from GitHub Actions.
Integration Architecture
ββββββββββββββββββββββββββββββββββββββββββββββ
β GitHub Actions Workflow β
β β
β ββββββββ ββββββββ βββββββββββββββββ β
β βBuild ββββ Test ββββ Create SNOW β β
β ββββββββ ββββββββ β Change Requestβ β
β βββββββββ¬ββββββββ β
β β β
β βΌ β
β ββββββββββββββββββββββ β
β β Wait for Approval β β
β ββββββββββββ¬ββββββββββ β
β β β
β βΌ β
β ββββββββββββββββββββββ β
β β Deploy Application β β
β ββββββββββββ¬ββββββββββ β
β β β
β βΌ β
β ββββββββββββββββββββββ β
β β Close Change β β
β ββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββ
β ServiceNow β
β Change Request β
ββββββββββββββββββββPrerequisites
ServiceNow Setup
API Access: ServiceNow instance with REST API enabled
Service Account: User with
itilrole for change managementOAuth Configuration (recommended for production)
GitHub Setup
Repository Secrets (Settings > Secrets and variables > Actions):
Repository Variables (optional):
Method 1: Direct REST API Integration
Basic Workflow
Create .github/workflows/deploy-with-servicenow.yml:
Method 2: Reusable Composite Actions
Create Custom Action
Create .github/actions/servicenow-change/action.yml:
Use Custom Action
Method 3: Python Script with GitHub Actions
Python Script Approach
Create .github/scripts/servicenow.py (see GitLab integration for full script)
Standard Changes for Faster Deployment
Pre-Approved Standard Change
Matrix Strategy for Multiple Environments
Emergency Change Workflow
Best Practices
Use Environment Protection Rules
Combine ServiceNow with GitHub environment protection:
Add Deployment Evidence
Handle Rollbacks
Troubleshooting
Debug API Calls
Common Issues
401 Unauthorized
Verify secrets are correctly set
Timeout waiting for approval
Check ServiceNow approval workflow, increase timeout
jq command not found
Use ubuntu-latest runner (includes jq)
Change not found
Verify sys_id is passed between jobs via outputs
Next Steps
Additional Resources
Last updated