66 ServiceNowDevOpsChange :
77 runs-on : ubuntu-latest
88 env :
9- ACTIONS_STEP_DEBUG : true # Enable GitHub Actions debug logging
10- ACTIONS_RUNNER_DEBUG : true # Enable runner debug logging
9+ ACTIONS_STEP_DEBUG : true
10+ ACTIONS_RUNNER_DEBUG : true
1111 steps :
12+ - name : Debug Input Values
13+ run : |
14+ echo "::debug::Instance URL: https://dev208227.service-now.com"
15+ echo "::debug::Tool ID: 35432ff783d87210340974b6feaad3bb"
16+ echo "::debug::Job Name: ServiceNow DevOps Change"
17+ echo "::debug::GitHub Context Keys: ${{ join(keys(github), ', ') }}"
18+ echo "::debug::GitHub Repository: ${{ github.repository }}"
19+ echo "::debug::GitHub Event: ${{ github.event_name }}"
20+ shell : bash
21+
1222 - name : ServiceNow DevOps Change
1323 uses : ServiceNow/servicenow-devops-change@main
14- id : change_request # Added ID for step reference
24+ id : change_request
25+ continue-on-error : true # Continue even if this step fails
1526 with :
1627 devops-integration-token : ${{ secrets.SN_DEVOPS_TOKEN }}
1728 instance-url : https://dev208227.service-now.com
@@ -20,16 +31,46 @@ jobs:
2031 job-name : ' ServiceNow DevOps Change'
2132 change-request : ' {"attributes":{"requested_by":{"name": "Test User"},"assignment_group":{"name": "Change Approval Team"},"priority": "2","comments": "This is a sample pipeline script to be added in your change step","work_notes": "Update this to work_notes","start_date": "2025-10-08 11:59:59","end_date": "2025-10-09 11:59:59"}}'
2233 deployment-gate : ' {"environment": "deploy-gates-demo", "jobName": "Deploy"}'
23-
24- - name : Capture and echo the ServiceNow change request response
34+ # Add shorter timeouts for faster debugging
35+ timeout : ' 300' # 5 minutes instead of default 1 hour
36+ interval : ' 30' # 30 seconds instead of default 100
37+ changeCreationTimeOut : ' 180' # 3 minutes instead of default 1 hour
38+
39+ - name : Debug ServiceNow Action Results
2540 run : |
26- echo "Change Request Response: ${{ steps.change_request.outputs.change-request-number }}"
27- echo "Change Request Sys ID: ${{ steps.change_request.outputs.change-request-sys-id }}"
41+ echo "Step outcome: ${{ steps.change_request.outcome }}"
42+ echo "Step conclusion: ${{ steps.change_request.conclusion }}"
43+ echo "Change Request Number: '${{ steps.change_request.outputs.change-request-number }}'"
44+ echo "Change Request Sys ID: '${{ steps.change_request.outputs.change-request-sys-id }}'"
2845
29- # Additional debug information
30- echo "::debug::GitHub Context: ${{ toJSON(github) }}"
31- echo "::debug::Job Name: ServiceNow DevOps Change"
32- echo "::debug::Instance URL: https://dev208227.service-now.com"
46+ # Check if outputs are empty
47+ if [ -z "${{ steps.change_request.outputs.change-request-number }}" ]; then
48+ echo "::warning::Change request number is empty"
49+ fi
50+
51+ if [ -z "${{ steps.change_request.outputs.change-request-sys-id }}" ]; then
52+ echo "::warning::Change request sys ID is empty"
53+ fi
54+ shell : bash
55+
56+ - name : Test ServiceNow Instance Connectivity
57+ if : failure() || steps.change_request.outcome == 'failure'
58+ run : |
59+ echo "Testing connectivity to ServiceNow instance..."
60+ curl -I https://dev208227.service-now.com || echo "Failed to connect to ServiceNow instance"
61+ shell : bash
62+
63+ - name : Validate Token (if possible)
64+ if : failure() || steps.change_request.outcome == 'failure'
65+ run : |
66+ if [ -n "${{ secrets.SN_DEVOPS_TOKEN }}" ]; then
67+ echo "DevOps integration token is provided"
68+ echo "Token length: ${#SN_DEVOPS_TOKEN}"
69+ else
70+ echo "::error::DevOps integration token is missing!"
71+ fi
72+ env :
73+ SN_DEVOPS_TOKEN : ${{ secrets.SN_DEVOPS_TOKEN }}
3374 shell : bash
3475 deploy :
3576 name : ' Deploy'
0 commit comments