Skip to content

Commit a619907

Browse files
committed
fix(deploy-to-aws-uv): simplify legacy-api-key plumbing — read inherited secrets
After review feedback (would have required all callers to switch from `secrets: inherit` to an explicit secret block — a big breaking change), revise the design so that the shared workflow reads inherited secrets directly. Caller workflows keep `secrets: inherit` and need no changes. The smoketest step's `legacy-api-key` input now picks up the first non-empty value from a fallback chain of standard GNS-Science API-key secrets: LEGACY_API_KEY NZSHM22_TOSHI_API_KEY NZSHM22_KORORAA_API_KEY NZSHM22_NSHM_MODEL_API_KEY NZSHM22_SOLVIS_API_KEY NZSHM22_HAZARD_API_KEY Each consumer's serverless.yml wires its own named secret into the Lambda authorizer's LEGACY_API_KEY env var; the same value flows through to the smoketest with no extra plumbing. The `secrets:` block on the workflow_call is dropped — no new caller- facing API surface.
1 parent 43630f4 commit a619907

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

.github/workflows/deploy-to-aws-uv.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,6 @@ on:
9494
type: string
9595
default: "data.*about.*Hello"
9696

97-
secrets:
98-
smoketest-legacy-api-key:
99-
description: |
100-
Optional fallback API key used by the Smoke Test step when serverless
101-
deploy output doesn't include a `TempApiKey-…` line (e.g. stacks that
102-
have moved past `apiGateway.apiKeys` to a Lambda authorizer with
103-
x-api-key compatibility). Passed to `apiSmokeTest`'s `legacy-api-key`
104-
input and auto-masked.
105-
required: false
106-
10797
jobs:
10898

10999
deploy:
@@ -191,4 +181,16 @@ jobs:
191181
expected-regex: ${{ inputs.smoketest-expected }}
192182
working-directory: ${{ inputs.working-directory}}
193183
url: ${{ (github.ref == 'refs/heads/main') && inputs.smoketest-url-prod || inputs.smoketest-url-test }}
194-
legacy-api-key: ${{ secrets.smoketest-legacy-api-key }}
184+
# Fallback x-api-key for stacks that have moved past `apiGateway.apiKeys`
185+
# to a Lambda authorizer (so no TempApiKey-* line in deploy.out).
186+
# Picks up any of the standard GNS-Science API-key secrets inherited via
187+
# `secrets: inherit`. Each consumer's serverless.yml wires its own
188+
# named secret into the Lambda authorizer's LEGACY_API_KEY env var.
189+
legacy-api-key: >-
190+
${{ secrets.LEGACY_API_KEY
191+
|| secrets.NZSHM22_TOSHI_API_KEY
192+
|| secrets.NZSHM22_KORORAA_API_KEY
193+
|| secrets.NZSHM22_NSHM_MODEL_API_KEY
194+
|| secrets.NZSHM22_SOLVIS_API_KEY
195+
|| secrets.NZSHM22_HAZARD_API_KEY
196+
|| '' }}

0 commit comments

Comments
 (0)