@@ -104,6 +104,10 @@ while [[ $# -gt 0 ]]; do
104104 version=" $2 "
105105 shift 2
106106 ;;
107+ --tableName) # Table name (optional)
108+ tableName=" $2 "
109+ shift 2
110+ ;;
107111 * )
108112 echo " [ERROR] Unknown argument: $1 "
109113 exit 1
@@ -202,6 +206,10 @@ if [[ -z "$version" ]]; then
202206 version=" "
203207fi
204208
209+ if [{ -z " $tableName " }]; then
210+ tableName=" "
211+ fi
212+
205213echo " ==================== Workflow Dispatch Parameters ===================="
206214echo " infraRepoName: $infraRepoName "
207215echo " releaseVersion: $releaseVersion "
@@ -221,6 +229,7 @@ echo " apimEnvironment: $apimEnvironment"
221229echo " boundedContext: $boundedContext "
222230echo " targetDomain: $targetDomain "
223231echo " version: $version "
232+ echo " tableName: $tableName "
224233
225234DISPATCH_EVENT=$( jq -ncM \
226235 --arg infraRepoName " $infraRepoName " \
@@ -240,6 +249,7 @@ DISPATCH_EVENT=$(jq -ncM \
240249 --arg boundedContext " $boundedContext " \
241250 --arg targetDomain " $targetDomain " \
242251 --arg version " $version " \
252+ --arg tableName " $tableName " \
243253 ' {
244254 "ref": "' " $internalRef " ' ",
245255 "inputs": (
@@ -255,6 +265,7 @@ DISPATCH_EVENT=$(jq -ncM \
255265 (if $boundedContext != "" then { "boundedContext": $boundedContext } else {} end) +
256266 (if $targetDomain != "" then { "targetDomain": $targetDomain } else {} end) +
257267 (if $version != "" then { "version": $version } else {} end) +
268+ (if $tableName != "" then { "tableName": $tableName } else {} end) +
258269 (if $targetAccountGroup != "" then { "targetAccountGroup": $targetAccountGroup } else {} end) +
259270 {
260271 "releaseVersion": $releaseVersion,
@@ -269,7 +280,7 @@ echo "[INFO] Triggering workflow '$targetWorkflow' in nhs-notify-internal..."
269280echo " [DEBUG] Dispatch event payload: $DISPATCH_EVENT "
270281
271282trigger_response=$( curl -s -L \
272- --fail \
283+ --fail-with-body \
273284 -X POST \
274285 -H " Accept: application/vnd.github+json" \
275286 -H " Authorization: Bearer ${PR_TRIGGER_PAT} " \
0 commit comments