Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit 98d90b4

Browse files
authored
Use ESC secrets
These changes migrate this repo's GitHub Actions Workflows to use ESC secrets instead of GitHub Secrets. The changes are largely mechanical: - Common configuration for all ESC actions within a workflow is added to the workflow's environment variables - Permissions are expanded as necessary for workflows that do not grant `id-token: write` permissions - `read-all` permissions are replaced with the union of all explicit read permissions and `id-token: write` - Default permissions are replaced with `write-all`, which is the equivalent of all explicit write permissions and `id-token: write` - Explicit permissions are modified to grant `id-token: write` - A step that fetches ESC secrets and populates environment variables is added to each step that reads secrets - Direct references to secrets within the job are replaced with references to the step's outputs All ESC actions are configured to fetch secrets from a shared ESC environment that contains secrets migrated from GitHub Actions. The ESC action performs its own OIDC exchange to obtain a Pulumi Access Token.
1 parent 7eff602 commit 98d90b4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
permissions: write-all # Equivalent to default permissions plus id-token: write
2+
env:
3+
ESC_ACTION_OIDC_AUTH: true
4+
ESC_ACTION_OIDC_ORGANIZATION: pulumi
5+
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
6+
ESC_ACTION_ENVIRONMENT: imports/github-secrets
7+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: false
18
name: Release Build
29
on:
310
push:
@@ -9,13 +16,16 @@ jobs:
916
name: Build Docker Image
1017
runs-on: ubuntu-latest
1118
steps:
19+
- name: Fetch secrets from ESC
20+
id: esc-secrets
21+
uses: pulumi/esc-action@v1
1222
- uses: actions/checkout@master
1323
- name: Build Snapshot & Publish to Registry
1424
uses: jen20/action-docker-build@v1
1525
with:
1626
repository: pulumi/pulumi-build-container
1727
buildkit: true
1828
username: pulumibot
19-
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
29+
password: ${{ steps.esc-secrets.outputs.DOCKER_HUB_PASSWORD }}
2030
tag-latest: true
2131
additional-tags: ${{ github.ref }}

0 commit comments

Comments
 (0)