1616# All arguments are required except terraformAction, and internalRef.
1717# Example:
1818# ./dispatch_internal_repo_workflow.sh \
19- # --infraRepoName "nhs-notify-web-template-management " \
19+ # --infraRepoName "nhs-notify-iam-webauth " \
2020# --releaseVersion "v1.2.3" \
2121# --targetWorkflow "deploy.yaml" \
2222# --targetEnvironment "prod" \
@@ -123,6 +123,7 @@ DISPATCH_EVENT=$(jq -ncM \
123123
124124echo " [INFO] Triggering workflow '$targetWorkflow ' in nhs-notify-internal..."
125125
126+ set -x
126127trigger_response=$( curl -s -L \
127128 --fail \
128129 -X POST \
@@ -131,6 +132,7 @@ trigger_response=$(curl -s -L \
131132 -H " X-GitHub-Api-Version: 2022-11-28" \
132133 " https://api.github.com/repos/NHSDigital/nhs-notify-internal/actions/workflows/$targetWorkflow /dispatches" \
133134 -d " $DISPATCH_EVENT " 2>&1 )
135+ set +x
134136
135137if [[ $? -ne 0 ]]; then
136138 echo " [ERROR] Failed to trigger workflow. Response: $trigger_response "
@@ -146,11 +148,13 @@ workflow_run_url=""
146148
147149for _ in {1..18}; do
148150
151+ set -x
149152 response=$( curl -s -L \
150153 -H " Accept: application/vnd.github+json" \
151154 -H " Authorization: Bearer ${PR_TRIGGER_PAT} " \
152155 -H " X-GitHub-Api-Version: 2022-11-28" \
153156 " https://api.github.com/repos/NHSDigital/nhs-notify-internal/actions/runs?event=workflow_dispatch" )
157+ set +x
154158
155159 if ! echo " $response " | jq empty 2> /dev/null; then
156160 echo " [ERROR] Invalid JSON response from GitHub API during workflow polling:"
0 commit comments