Skip to content

Commit 2d9f1e0

Browse files
committed
Use ESC secrets
1 parent a326ff1 commit 2d9f1e0

File tree

2 files changed

+32
-16
lines changed

2 files changed

+32
-16
lines changed

.github/workflows/pr-test.yml

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
permissions:
2+
id-token: write
13
on:
2-
pull_request:
3-
4+
pull_request: null
45
name: PR test
56

67
jobs:
@@ -9,21 +10,24 @@ jobs:
910
runs-on: ubuntu-latest
1011

1112
steps:
13+
- name: Fetch secrets from ESC
14+
id: esc-secrets
15+
uses: pulumi/esc-action@v1
1216
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1317

1418
- name: Login to Docker Hub as pulumi-bot
1519
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
1620
with:
17-
username: ${{ secrets.DOCKERHUB_USERNAME }}
18-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
21+
username: ${{ steps.esc-secrets.outputs.DOCKERHUB_USERNAME }}
22+
password: ${{ steps.esc-secrets.outputs.DOCKERHUB_PASSWORD }}
1923

2024
- uses: ./.github/actions/run-self-hosted
2125
timeout-minutes: 2
2226
env:
2327
# When regenerating the license, create a restricted license.
2428
# That is, create a license that has a max unit of just 1 unless
2529
# otherwise required.
26-
PULUMI_LICENSE_KEY: ${{ secrets.PULUMI_LICENSE_KEY }}
30+
PULUMI_LICENSE_KEY: ${{ steps.esc-secrets.outputs.PULUMI_LICENSE_KEY }}
2731
with:
2832
compose-args: '-f ./quickstart-docker-compose/all-in-one/docker-compose.yml'
2933

@@ -34,4 +38,9 @@ jobs:
3438
name: service-log
3539
path: ${{ env.SERVICE_LOG }}
3640
overwrite: true
37-
41+
env:
42+
ESC_ACTION_OIDC_AUTH: true
43+
ESC_ACTION_OIDC_ORGANIZATION: pulumi
44+
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
45+
ESC_ACTION_ENVIRONMENT: imports/github-secrets
46+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: false

.github/workflows/test-with-minio.yml

+17-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
permissions:
2+
id-token: write
13
# workflow_dispatch allows for manual triggering from the GitHub Actions UI, as well
24
# as the API. repository_dispatch allows us to trigger multiple workflows that
35
# match on an event_type parameter when triggered via an API call.
46
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
57
on:
6-
pull_request:
7-
workflow_dispatch:
8-
8+
pull_request: null
9+
workflow_dispatch: null
910
repository_dispatch:
1011
types: [integration_tests]
1112

@@ -24,12 +25,12 @@ jobs:
2425
MINIO_HOST: "minio:9000"
2526
MINIO_BUCKET_NAME: "pulumi-checkpoints"
2627
MINIO_PP_BUCKET_NAME: "pulumi-policy-packs"
27-
# When regenerating the license, create a restricted license.
28-
# That is, create a license that has a max unit of just 1 unless
29-
# otherwise required.
30-
PULUMI_LICENSE_KEY: ${{ secrets.PULUMI_LICENSE_KEY }}
28+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: PULUMI_LICENSE_KEY=PULUMI_LICENSE_KEY
3129

3230
steps:
31+
- name: Fetch secrets from ESC
32+
id: esc-secrets
33+
uses: pulumi/esc-action@v1
3334
- name: Set env vars
3435
run: |
3536
# There doesn't seem to be a way to map environment variables into other enviroments
@@ -62,8 +63,8 @@ jobs:
6263
- name: Login to Docker Hub as pulumi-bot
6364
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
6465
with:
65-
username: ${{ secrets.DOCKERHUB_USERNAME }}
66-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
66+
username: ${{ steps.esc-secrets.outputs.DOCKERHUB_USERNAME }}
67+
password: ${{ steps.esc-secrets.outputs.DOCKERHUB_PASSWORD }}
6768

6869
- name: Run Minio
6970
run: |
@@ -124,8 +125,14 @@ jobs:
124125
# The Slack webhook URL must be specific to the pulumi-service Slack channel.
125126
# The name of the Slack app is "Pulumi Webhooks". You must have access to it
126127
# to be able to see it on https://api.slack.com.
127-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
128+
SLACK_WEBHOOK_URL: ${{ steps.esc-secrets.outputs.SLACK_WEBHOOK_URL }}
128129
with:
129130
text: Minio integration test in pulumi-self-hosted-installers failed for service's latest edge build
130131
fields: job,workflow
131132
status: ${{ job.status }}
133+
env:
134+
ESC_ACTION_OIDC_AUTH: true
135+
ESC_ACTION_OIDC_ORGANIZATION: pulumi
136+
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
137+
ESC_ACTION_ENVIRONMENT: imports/github-secrets
138+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: false

0 commit comments

Comments
 (0)