@@ -32,18 +32,21 @@ jobs:
3232 role-session-name : opencode-${{ github.run_id }}
3333 aws-region : us-east-1
3434
35- - name : Read deploy secrets
36- uses : aws-actions/aws-secretsmanager-get-secrets@2297f9a879480a9e3af9b293ed15c70caf8e1c88 # v3.0.2
37- with :
38- secret-ids : CLOUDFLARE_API_TOKEN,opencode/${{ github.ref_name }}/CLOUDFLARE_API_TOKEN
39- parse-json-secrets : false
35+ # A 15-minute token for this stage's Workers only, minted by the token issuer (anomalyco/secrets) from the role
36+ # above. It is a step output, so only the Deploy step gets it.
37+ - name : Cloudflare token
38+ id : cloudflare-token
39+ run : bash .github/release/cloudflare-token.sh
40+ env :
41+ CLOUDFLARE_TOKEN_URL : ${{ vars.CLOUDFLARE_TOKEN_URL }}
4042
41- # The GitHub App secrets are read here, not in the step above, so only this step ever has them. They reach cf
42- # through a file in the runner's temp directory, never argv, and the file is removed when the step ends.
43+ # The GitHub App secrets are read here, so only this step ever has them. They reach cf through a file in the
44+ # runner's temp directory, never argv, and the file is removed when the step ends.
4345 - name : Deploy
4446 working-directory : services/legacy
4547 env :
4648 STAGE : ${{ github.ref_name }}
49+ CLOUDFLARE_API_TOKEN : ${{ steps.cloudflare-token.outputs.token }}
4750 # An explicit bash runs with pipefail, so a failed secret read fails the step.
4851 shell : bash
4952 run : |
@@ -80,18 +83,19 @@ jobs:
8083 role-session-name : opencode-${{ github.run_id }}
8184 aws-region : us-east-1
8285
83- - name : Read deploy secrets
84- uses : aws-actions/aws-secretsmanager-get-secrets@2297f9a879480a9e3af9b293ed15c70caf8e1c88 # v3.0.2
85- with :
86- secret-ids : CLOUDFLARE_API_TOKEN,opencode/${{ github.ref_name }}/CLOUDFLARE_API_TOKEN
87- parse-json-secrets : false
86+ - name : Cloudflare token
87+ id : cloudflare-token
88+ run : bash .github/release/cloudflare-token.sh
89+ env :
90+ CLOUDFLARE_TOKEN_URL : ${{ vars.CLOUDFLARE_TOKEN_URL }}
8891
89- # The Workers' secrets are read here, not in the step above, so only this step ever has them. They reach cf
90- # through files in the runner's temp directory, never argv, and are removed when the step ends.
92+ # The Workers' secrets are read here, so only this step ever has them. They reach cf through files in the
93+ # runner's temp directory, never argv, and are removed when the step ends.
9194 - name : Deploy
9295 working-directory : services/data
9396 env :
9497 STAGE : ${{ github.ref_name }}
98+ CLOUDFLARE_API_TOKEN : ${{ steps.cloudflare-token.outputs.token }}
9599 # An explicit bash runs with pipefail, so a failed secret read fails the step.
96100 shell : bash
97101 run : |
0 commit comments