GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ci: read deploy and release secrets from aws secrets manager (#62954) · jerrylee/opencode@ae3aa94

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github
    • actions/setup-git-committer
      • action.yml
    • release
      • lib.sh
    • workflows
      • bot-docs-locale.yml
      • deploy-files.yml
      • deploy-site.yml
      • deploy-update.yml
      • deploy.yml
      • release-dry-run.yml
      • release.yml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/actions/setup-git-committer/action.yml‎

Copy file name to clipboardExpand all lines: .github/actions/setup-git-committer/action.yml
-43Lines changed: 0 additions & 43 deletions
This file was deleted.
Collapse file

‎.github/release/lib.sh‎

Copy file name to clipboardExpand all lines: .github/release/lib.sh
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ r2_credentials() {
9090
export AWS_ACCESS_KEY_ID="$id"
9191
AWS_SECRET_ACCESS_KEY=$(printf '%s' "$CLOUDFLARE_API_TOKEN" | sha256 | cut -c1-64)
9292
export AWS_SECRET_ACCESS_KEY
93+
# These are R2's own credentials, so drop the role credentials the job assumed to read Secrets Manager.
94+
unset AWS_SESSION_TOKEN AWS_PROFILE AWS_REGION
9395
export AWS_DEFAULT_REGION=auto AWS_REQUEST_CHECKSUM_CALCULATION=when_required AWS_RESPONSE_CHECKSUM_VALIDATION=when_required
9496
# Larger parts mean fewer CompleteMultipartUpload parts for the 200-350 MB desktop builds.
9597
AWS_CONFIG_FILE=$(mktemp)
Collapse file

‎.github/workflows/bot-docs-locale.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/bot-docs-locale.yml
-101Lines changed: 0 additions & 101 deletions
This file was deleted.
Collapse file

‎.github/workflows/deploy-files.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/deploy-files.yml
+16-2Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
if: github.repository == 'anomalyco/opencode' && (github.ref_name == 'dev' || github.ref_name == 'production')
2020
runs-on: blacksmith-4vcpu-ubuntu-2404
2121
environment: ${{ github.ref_name }}
22+
permissions:
23+
contents: read
24+
id-token: write
2225
steps:
2326
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2427

@@ -28,8 +31,19 @@ jobs:
2831
working-directory: services/files
2932
run: bun run typecheck:tsc
3033

34+
- name: Configure AWS credentials
35+
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
36+
with:
37+
role-to-assume: arn:aws:iam::604439173067:role/github/opencode-${{ github.ref_name }}
38+
role-session-name: opencode-${{ github.run_id }}
39+
aws-region: us-east-1
40+
41+
- name: Read deploy secrets
42+
uses: aws-actions/aws-secretsmanager-get-secrets@2297f9a879480a9e3af9b293ed15c70caf8e1c88 # v3.0.2
43+
with:
44+
secret-ids: CLOUDFLARE_API_TOKEN,opencode/${{ github.ref_name }}/CLOUDFLARE_API_TOKEN
45+
parse-json-secrets: false
46+
3147
- name: Deploy
3248
working-directory: services/files
3349
run: bun run deploy --env ${{ github.ref_name == 'production' && 'production' || 'dev' }}
34-
env:
35-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
Collapse file

‎.github/workflows/deploy-site.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/deploy-site.yml
+16-2Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
if: github.repository == 'anomalyco/opencode' && (github.ref_name == 'dev' || github.ref_name == 'production')
2020
runs-on: blacksmith-4vcpu-ubuntu-2404
2121
environment: ${{ github.ref_name }}
22+
permissions:
23+
contents: read
24+
id-token: write
2225
steps:
2326
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2427

@@ -32,8 +35,19 @@ jobs:
3235
env:
3336
GITHUB_TOKEN: ${{ github.token }}
3437

38+
- name: Configure AWS credentials
39+
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
40+
with:
41+
role-to-assume: arn:aws:iam::604439173067:role/github/opencode-${{ github.ref_name }}
42+
role-session-name: opencode-${{ github.run_id }}
43+
aws-region: us-east-1
44+
45+
- name: Read deploy secrets
46+
uses: aws-actions/aws-secretsmanager-get-secrets@2297f9a879480a9e3af9b293ed15c70caf8e1c88 # v3.0.2
47+
with:
48+
secret-ids: CLOUDFLARE_API_TOKEN,opencode/${{ github.ref_name }}/CLOUDFLARE_API_TOKEN
49+
parse-json-secrets: false
50+
3551
- name: Deploy
3652
working-directory: services/site
3753
run: bunx cf deploy --prebuilt --mode ${{ github.ref_name }}
38-
env:
39-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
Collapse file

‎.github/workflows/deploy-update.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/deploy-update.yml
+16-2Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
if: github.repository == 'anomalyco/opencode' && github.ref_name == 'production'
1919
runs-on: blacksmith-4vcpu-ubuntu-2404
2020
environment: production
21+
permissions:
22+
contents: read
23+
id-token: write
2124
steps:
2225
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2326

@@ -27,8 +30,19 @@ jobs:
2730
working-directory: services/update
2831
run: bun run typecheck:tsc
2932

33+
- name: Configure AWS credentials
34+
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
35+
with:
36+
role-to-assume: arn:aws:iam::604439173067:role/github/opencode-production
37+
role-session-name: opencode-${{ github.run_id }}
38+
aws-region: us-east-1
39+
40+
- name: Read deploy secrets
41+
uses: aws-actions/aws-secretsmanager-get-secrets@2297f9a879480a9e3af9b293ed15c70caf8e1c88 # v3.0.2
42+
with:
43+
secret-ids: CLOUDFLARE_API_TOKEN,opencode/production/CLOUDFLARE_API_TOKEN
44+
parse-json-secrets: false
45+
3046
- name: Deploy
3147
working-directory: services/update
3248
run: bun run deploy
33-
env:
34-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
Collapse file

‎.github/workflows/deploy.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/deploy.yml
+41-6Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
if: github.repository == 'anomalyco/opencode' && (github.ref_name == 'dev' || github.ref_name == 'production' || github.ref_name == 'beta')
1919
runs-on: blacksmith-4vcpu-ubuntu-2404
2020
environment: ${{ github.ref_name }}
21+
permissions:
22+
contents: read
23+
id-token: write
2124
steps:
2225
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2326

@@ -27,13 +30,31 @@ jobs:
2730
with:
2831
node-version: "24"
2932

33+
# beta has no branch, environment or AWS role. Running it again needs a role trusting environment `beta` and
34+
# opencode/beta/CLOUDFLARE_API_TOKEN and opencode/beta/PLANETSCALE_SERVICE_TOKEN.
35+
- name: Configure AWS credentials
36+
if: github.ref_name != 'beta'
37+
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
38+
with:
39+
role-to-assume: arn:aws:iam::604439173067:role/github/opencode-${{ github.ref_name }}
40+
role-session-name: opencode-${{ github.run_id }}
41+
aws-region: us-east-1
42+
43+
- name: Read deploy secrets
44+
if: github.ref_name != 'beta'
45+
uses: aws-actions/aws-secretsmanager-get-secrets@2297f9a879480a9e3af9b293ed15c70caf8e1c88 # v3.0.2
46+
with:
47+
secret-ids: |
48+
CLOUDFLARE_API_TOKEN,opencode/${{ github.ref_name }}/CLOUDFLARE_API_TOKEN
49+
PLANETSCALE_SERVICE_TOKEN,opencode/${{ github.ref_name }}/PLANETSCALE_SERVICE_TOKEN
50+
parse-json-secrets: false
51+
3052
- run: bun sst deploy --stage=${{ github.ref_name }}
3153
env:
3254
GITHUB_TOKEN: ${{ github.token }}
33-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
34-
PLANETSCALE_SERVICE_TOKEN_NAME: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_NAME }}
35-
PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }}
36-
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
55+
PLANETSCALE_SERVICE_TOKEN_NAME: ${{ vars.PLANETSCALE_SERVICE_TOKEN_NAME }}
56+
# Only the beta stage's web app uploads sourcemaps; packages/app skips the upload without a token.
57+
SENTRY_AUTH_TOKEN: ${{ github.ref_name == 'beta' && secrets.SENTRY_AUTH_TOKEN || '' }}
3758
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
3859
SENTRY_PROJECT: ${{ vars.WEB_SENTRY_PROJECT }}
3960
SENTRY_RELEASE: web@${{ github.sha }}
@@ -47,12 +68,26 @@ jobs:
4768
if: github.repository == 'anomalyco/opencode' && github.ref_name != 'beta'
4869
runs-on: blacksmith-4vcpu-ubuntu-2404
4970
environment: ${{ github.ref_name }}
71+
permissions:
72+
contents: read
73+
id-token: write
5074
steps:
5175
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
5276

5377
- uses: ./.github/actions/setup-bun
5478

79+
- name: Configure AWS credentials
80+
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
81+
with:
82+
role-to-assume: arn:aws:iam::604439173067:role/github/opencode-${{ github.ref_name }}
83+
role-session-name: opencode-${{ github.run_id }}
84+
aws-region: us-east-1
85+
86+
- name: Read deploy secrets
87+
uses: aws-actions/aws-secretsmanager-get-secrets@2297f9a879480a9e3af9b293ed15c70caf8e1c88 # v3.0.2
88+
with:
89+
secret-ids: CLOUDFLARE_API_TOKEN,opencode/${{ github.ref_name }}/CLOUDFLARE_API_TOKEN
90+
parse-json-secrets: false
91+
5592
- run: bun run deploy:${{ github.ref_name }}
5693
working-directory: services/share
57-
env:
58-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.