1- name : " Publish supplier config to DynamoDB "
2- description : " Reads config from a file store and publishes records to a DynamoDB table ."
1+ name : " Publish supplier config to EventBridge "
2+ description : " Reads config from a file store and publishes records to an event bus ."
33author : " NHS Notify"
44
55inputs :
99 target-env :
1010 description : " Target environment label (e.g. draft/int/prod)"
1111 required : true
12- table-name :
13- description : " DynamoDB table name"
14- required : true
15- topic-arn :
16- description : " ARN of SNS topic to publish events to"
12+ event-bus-name :
13+ description : " Name of event bus to publish to"
1714 required : true
1815 force :
1916 description : " Bypass audit safety checks"
@@ -27,26 +24,26 @@ inputs:
2724runs :
2825 using : " composite"
2926 steps :
30- - name : Resolve and download ddb -publish bundle
27+ - name : Resolve and download eventbridge -publish bundle
3128 shell : bash
3229 env :
3330 GH_TOKEN : ${{ github.token }}
3431 CALLER_REPO : ${{ github.repository }}
3532 ACTION_REPO : ${{ github.action_repository }}
3633 ACTION_REF : ${{ github.action_ref }}
37- RELEASE_ASSET_NAME : ddb -publish-bundle.tgz
38- WORKFLOW_ARTIFACT_NAME : ddb -publish-bundle
34+ RELEASE_ASSET_NAME : eventbridge -publish-bundle.tgz
35+ WORKFLOW_ARTIFACT_NAME : eventbridge -publish-bundle
3936 run : |
4037 set -euo pipefail
4138
42- download_dir="${RUNNER_TEMP}/ddb -publish"
39+ download_dir="${RUNNER_TEMP}/eventbridge -publish"
4340 unpack_dir="${download_dir}/unpacked"
4441
4542 mkdir -p "${download_dir}" "${unpack_dir}"
4643
47- echo "[ddb -publish] caller_repo=${CALLER_REPO}"
48- echo "[ddb -publish] action_repo=${ACTION_REPO}"
49- echo "[ddb -publish] action_ref=${ACTION_REF:-<empty>}"
44+ echo "[eventbridge -publish] caller_repo=${CALLER_REPO}"
45+ echo "[eventbridge -publish] action_repo=${ACTION_REPO}"
46+ echo "[eventbridge -publish] action_ref=${ACTION_REF:-<empty>}"
5047
5148 if [[ -z "${ACTION_REF}" ]]; then
5249 echo "ERROR: github.action_ref is empty; unable to locate release asset or branch artifact." >&2
@@ -60,22 +57,22 @@ runs:
6057
6158 # Prefer release assets when the action ref is a tag with a matching release in the action repo.
6259 if gh release view "${ACTION_REF}" --repo "${ACTION_REPO}" >/dev/null 2>&1; then
63- echo "[ddb -publish] Found release for ref '${ACTION_REF}' in '${ACTION_REPO}'. Downloading '${RELEASE_ASSET_NAME}'."
60+ echo "[eventbridge -publish] Found release for ref '${ACTION_REF}' in '${ACTION_REPO}'. Downloading '${RELEASE_ASSET_NAME}'."
6461 gh release download "${ACTION_REF}" --repo "${ACTION_REPO}" --pattern "${RELEASE_ASSET_NAME}" --dir "${download_dir}"
6562 tar -xzf "${download_dir}/${RELEASE_ASSET_NAME}" -C "${unpack_dir}"
66- echo "[ddb -publish] Bundle extracted from release asset."
63+ echo "[eventbridge -publish] Bundle extracted from release asset."
6764 exit 0
6865 fi
6966
7067 # Otherwise treat the ref as a branch-like ref and fetch the latest successful CI artifact from the action repo.
7168 branch="${ACTION_REF#refs/heads/}"
72- echo "[ddb -publish] No release found for ref '${ACTION_REF}'. Falling back to latest workflow artifact on branch '${branch}' from '${ACTION_REPO}'."
69+ echo "[eventbridge -publish] No release found for ref '${ACTION_REF}'. Falling back to latest workflow artifact on branch '${branch}' from '${ACTION_REPO}'."
7370
7471 run_id=""
7572 workflow_used=""
7673
7774 for workflow_file in "stage-3-build.yaml" "cicd-1-pull-request.yaml"; do
78- echo "[ddb -publish] Looking for successful runs in workflow '${workflow_file}'."
75+ echo "[eventbridge -publish] Looking for successful runs in workflow '${workflow_file}'."
7976
8077 set +e
8178 run_id_candidate="$(gh run list \
@@ -84,18 +81,18 @@ runs:
8481 --branch "${branch}" \
8582 --status success \
8683 --json databaseId \
87- --jq '.[0].databaseId' 2>/tmp/ddb_publish_run_list_err .log)"
84+ --jq '.[0].databaseId' 2>/tmp/eventbridge_publish_run_list_err .log)"
8885 rc=$?
8986 set -e
9087
9188 if [[ $rc -ne 0 ]]; then
92- if grep -q "HTTP 404" /tmp/ddb_publish_run_list_err .log; then
93- echo "[ddb -publish] Workflow '${workflow_file}' not found on default branch; trying next workflow candidate."
89+ if grep -q "HTTP 404" /tmp/eventbridge_publish_run_list_err .log; then
90+ echo "[eventbridge -publish] Workflow '${workflow_file}' not found on default branch; trying next workflow candidate."
9491 continue
9592 fi
9693
9794 echo "ERROR: Failed to query workflow runs from '${ACTION_REPO}' for workflow '${workflow_file}'." >&2
98- cat /tmp/ddb_publish_run_list_err .log >&2 || true
95+ cat /tmp/eventbridge_publish_run_list_err .log >&2 || true
9996 echo "HINT: ensure the token has read access to '${ACTION_REPO}' and workflow permissions allow actions read." >&2
10097 exit 1
10198 fi
@@ -112,7 +109,7 @@ runs:
112109 exit 1
113110 fi
114111
115- echo "[ddb -publish] Downloading artifact '${WORKFLOW_ARTIFACT_NAME}' from workflow run ${run_id} (${workflow_used}) in '${ACTION_REPO}'."
112+ echo "[eventbridge -publish] Downloading artifact '${WORKFLOW_ARTIFACT_NAME}' from workflow run ${run_id} (${workflow_used}) in '${ACTION_REPO}'."
116113 gh run download "${run_id}" --repo "${ACTION_REPO}" --name "${WORKFLOW_ARTIFACT_NAME}" --dir "${download_dir}"
117114
118115 tarball_path="${download_dir}/${RELEASE_ASSET_NAME}"
@@ -123,22 +120,22 @@ runs:
123120 fi
124121
125122 tar -xzf "${tarball_path}" -C "${unpack_dir}"
126- echo "[ddb -publish] Bundle extracted from workflow artifact."
123+ echo "[eventbridge -publish] Bundle extracted from workflow artifact."
127124
128125 - name : Run publisher
129126 shell : bash
130127 run : |
131128 set -euo pipefail
132129
133- echo "[ddb -publish] Starting publish run"
134- echo "[ddb -publish] source='${{ inputs.source-path }}' env='${{ inputs.target-env }}' table='${{ inputs.table-name }}' force='${{ inputs.force }}' dry-run='${{ inputs.dry-run }}'"
130+ echo "[eventbridge -publish] Starting publish run"
131+ echo "[eventbridge -publish] source='${{ inputs.source-path }}' env='${{ inputs.target-env }}' table='${{ inputs.table-name }}' force='${{ inputs.force }}' dry-run='${{ inputs.dry-run }}'"
135132
136- node "${RUNNER_TEMP}/ddb -publish/unpacked/index.cjs" \
133+ node "${RUNNER_TEMP}/eventbridge -publish/unpacked/index.cjs" \
137134 --source "${{ inputs.source-path }}" \
138135 --env "${{ inputs.target-env }}" \
139136 --table "${{ inputs.table-name }}" \
140137 --topic-arn ${{ inputs.topic-arn }} \
141138 $([[ "${{ inputs.force }}" == "true" ]] && echo "--force") \
142139 $([[ "${{ inputs.dry-run }}" == "true" ]] && echo "--dry-run")
143140
144- echo "[ddb -publish] Publish run completed"
141+ echo "[eventbridge -publish] Publish run completed"
0 commit comments