Skip to content
16 changes: 10 additions & 6 deletions .github/scripts/dispatch_internal_repo_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ if [[ -z "$extraSecretNames" ]]; then
extraSecretNames=""
fi

if [{ -z "$tableName" }]; then
if [[ -z "$tableName" ]]; then
tableName=""
fi

Expand Down Expand Up @@ -306,17 +306,21 @@ echo "[INFO] Triggering workflow '$targetWorkflow' in nhs-notify-internal..."

echo "[DEBUG] Dispatch event payload: $DISPATCH_EVENT"

trigger_response=$(curl -s -L \
--fail \
trigger_http_code=$(curl -s -L \
-o /tmp/dispatch_response.json \
-w "%{http_code}" \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${PR_TRIGGER_PAT}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/NHSDigital/nhs-notify-internal/actions/workflows/$targetWorkflow/dispatches" \
-d "$DISPATCH_EVENT" 2>&1)
-d "$DISPATCH_EVENT")

if [[ $? -ne 0 ]]; then
echo "[ERROR] Failed to trigger workflow. Response: $trigger_response"
trigger_response=$(cat /tmp/dispatch_response.json)

if [[ "$trigger_http_code" -lt 200 || "$trigger_http_code" -ge 300 ]]; then
echo "[ERROR] Failed to trigger workflow. HTTP status: $trigger_http_code"
echo "[ERROR] Response body: $trigger_response"
exit 1
fi

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stage-3-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ jobs:
.github/scripts/dispatch_internal_repo_workflow.sh \
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
--releaseVersion ${{ github.head_ref || github.ref_name }} \
--targetWorkflow "publish-supplier-config.yaml" \
--targetWorkflow "publish-supplier-config-to-ddb.yaml" \
Comment thread
masl2 marked this conversation as resolved.
--targetEnvironment "${{ steps.set-environment.outputs.environment_name }}" \
--internalRef "feature/CCM-17337-Publish-Supplier-Configuration-Event" \
Comment thread
masl2 marked this conversation as resolved.
Outdated
--targetComponent "config" \
--targetAccountGroup "nhs-notify-suppliers-dev" \
--tableName "supplier-config" \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"allocationPercentage": 30,
"id": "supplier1-volumeGroup-test1",
"id": "supplier1-volume-group-test1",
"status": "PROD",
"supplier": "supplier1",
"volumeGroup": "volumeGroup-test1"
"volumeGroup": "volume-group-test1"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"allocationPercentage": 100,
"id": "supplier1-volumeGroup-test2",
"id": "supplier1-volume-group-test2",
"status": "PROD",
"supplier": "supplier1",
"volumeGroup": "volumeGroup-test2"
"volumeGroup": "volume-group-test2"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"allocationPercentage": 100,
"id": "supplier1-volumeGroup-test3",
"id": "supplier1-volume-group-test3",
"status": "PROD",
"supplier": "supplier1",
"volumeGroup": "volumeGroup-test3"
"volumeGroup": "volume-group-test3"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"allocationPercentage": 70,
"id": "supplier2-volumeGroup-test1",
"id": "supplier2-volume-group-test1",
"status": "PROD",
"supplier": "supplier2",
"volumeGroup": "volumeGroup-test1"
"volumeGroup": "volume-group-test1"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "Dev Test Volume Group 1",
"id": "volumeGroup-test1",
"id": "volume-group-test1",
"name": "Dev Test Volume Group 1",
"startDate": "2026-01-01",
"status": "PROD"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "Dev Test Volume Group 2",
"id": "volumeGroup-test2",
"id": "volume-group-test2",
"name": "Dev Test Volume Group 2",
"startDate": "2026-01-01",
"status": "PROD"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "Dev Test Volume Group 3",
"id": "volumeGroup-test3",
"id": "volume-group-test3",
"name": "Dev Test Volume Group 3",
"startDate": "2026-01-01",
"status": "PROD"
Expand Down
Loading