Skip to content

Commit afd9b7d

Browse files
committed
Use ESC secrets
1 parent cb573e3 commit afd9b7d

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

.github/workflows/pr-test.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
on:
2-
pull_request:
3-
2+
pull_request: null
43
name: PR test
54

65
jobs:
@@ -9,21 +8,24 @@ jobs:
98
runs-on: ubuntu-latest
109

1110
steps:
11+
- name: Fetch secrets from ESC
12+
id: esc-secrets
13+
uses: pulumi/esc-action@v1
1214
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1315

1416
- name: Login to Docker Hub as pulumi-bot
1517
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
1618
with:
17-
username: ${{ secrets.DOCKERHUB_USERNAME }}
18-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
19+
username: ${{ steps.esc-secrets.outputs.DOCKERHUB_USERNAME }}
20+
password: ${{ steps.esc-secrets.outputs.DOCKERHUB_PASSWORD }}
1921

2022
- uses: ./.github/actions/run-self-hosted
2123
timeout-minutes: 2
2224
env:
2325
# When regenerating the license, create a restricted license.
2426
# That is, create a license that has a max unit of just 1 unless
2527
# otherwise required.
26-
PULUMI_LICENSE_KEY: ${{ secrets.PULUMI_LICENSE_KEY }}
28+
PULUMI_LICENSE_KEY: ${{ steps.esc-secrets.outputs.PULUMI_LICENSE_KEY }}
2729
with:
2830
compose-args: '-f ./quickstart-docker-compose/all-in-one/docker-compose.yml'
2931

@@ -34,4 +36,10 @@ jobs:
3436
name: service-log
3537
path: ${{ env.SERVICE_LOG }}
3638
overwrite: true
37-
39+
env:
40+
ESC_ACTION_OIDC_AUTH: true
41+
ESC_ACTION_OIDC_ORGANIZATION: pulumi
42+
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
43+
ESC_ACTION_ENVIRONMENT: imports/github-secrets
44+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: false
45+
permissions: write-all # Equivalent to default permissions plus id-token: write

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

+16-10
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
# match on an event_type parameter when triggered via an API call.
44
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
55
on:
6-
pull_request:
7-
workflow_dispatch:
8-
6+
pull_request: null
7+
workflow_dispatch: null
98
repository_dispatch:
109
types: [integration_tests]
1110

@@ -24,12 +23,12 @@ jobs:
2423
MINIO_HOST: "minio:9000"
2524
MINIO_BUCKET_NAME: "pulumi-checkpoints"
2625
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 }}
26+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: PULUMI_LICENSE_KEY=PULUMI_LICENSE_KEY
3127

3228
steps:
29+
- name: Fetch secrets from ESC
30+
id: esc-secrets
31+
uses: pulumi/esc-action@v1
3332
- name: Set env vars
3433
run: |
3534
# There doesn't seem to be a way to map environment variables into other enviroments
@@ -62,8 +61,8 @@ jobs:
6261
- name: Login to Docker Hub as pulumi-bot
6362
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
6463
with:
65-
username: ${{ secrets.DOCKERHUB_USERNAME }}
66-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
64+
username: ${{ steps.esc-secrets.outputs.DOCKERHUB_USERNAME }}
65+
password: ${{ steps.esc-secrets.outputs.DOCKERHUB_PASSWORD }}
6766

6867
- name: Run Minio
6968
run: |
@@ -124,8 +123,15 @@ jobs:
124123
# The Slack webhook URL must be specific to the pulumi-service Slack channel.
125124
# The name of the Slack app is "Pulumi Webhooks". You must have access to it
126125
# to be able to see it on https://api.slack.com.
127-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
126+
SLACK_WEBHOOK_URL: ${{ steps.esc-secrets.outputs.SLACK_WEBHOOK_URL }}
128127
with:
129128
text: Minio integration test in pulumi-self-hosted-installers failed for service's latest edge build
130129
fields: job,workflow
131130
status: ${{ job.status }}
131+
env:
132+
ESC_ACTION_OIDC_AUTH: true
133+
ESC_ACTION_OIDC_ORGANIZATION: pulumi
134+
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
135+
ESC_ACTION_ENVIRONMENT: imports/github-secrets
136+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: false
137+
permissions: write-all # Equivalent to default permissions plus id-token: write

0 commit comments

Comments
 (0)