Skip to content

Commit 2e6b673

Browse files
committed
Use ESC secrets
1 parent cb573e3 commit 2e6b673

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,12 @@
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
on:
2-
pull_request:
3-
9+
pull_request: null
410
name: PR test
511

612
jobs:
@@ -9,21 +15,24 @@ jobs:
915
runs-on: ubuntu-latest
1016

1117
steps:
18+
- name: Fetch secrets from ESC
19+
id: esc-secrets
20+
uses: pulumi/esc-action@v1
1221
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1322

1423
- name: Login to Docker Hub as pulumi-bot
1524
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
1625
with:
17-
username: ${{ secrets.DOCKERHUB_USERNAME }}
18-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
26+
username: ${{ steps.esc-secrets.outputs.DOCKERHUB_USERNAME }}
27+
password: ${{ steps.esc-secrets.outputs.DOCKERHUB_PASSWORD }}
1928

2029
- uses: ./.github/actions/run-self-hosted
2130
timeout-minutes: 2
2231
env:
2332
# When regenerating the license, create a restricted license.
2433
# That is, create a license that has a max unit of just 1 unless
2534
# otherwise required.
26-
PULUMI_LICENSE_KEY: ${{ secrets.PULUMI_LICENSE_KEY }}
35+
PULUMI_LICENSE_KEY: ${{ steps.esc-secrets.outputs.PULUMI_LICENSE_KEY }}
2736
with:
2837
compose-args: '-f ./quickstart-docker-compose/all-in-one/docker-compose.yml'
2938

@@ -34,4 +43,3 @@ jobs:
3443
name: service-log
3544
path: ${{ env.SERVICE_LOG }}
3645
overwrite: true
37-

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

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
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
# workflow_dispatch allows for manual triggering from the GitHub Actions UI, as well
29
# as the API. repository_dispatch allows us to trigger multiple workflows that
310
# match on an event_type parameter when triggered via an API call.
411
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
512
on:
6-
pull_request:
7-
workflow_dispatch:
8-
13+
pull_request: null
14+
workflow_dispatch: null
915
repository_dispatch:
1016
types: [integration_tests]
1117

@@ -24,12 +30,12 @@ jobs:
2430
MINIO_HOST: "minio:9000"
2531
MINIO_BUCKET_NAME: "pulumi-checkpoints"
2632
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 }}
33+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: PULUMI_LICENSE_KEY
3134

3235
steps:
36+
- name: Fetch secrets from ESC
37+
id: esc-secrets
38+
uses: pulumi/esc-action@v1
3339
- name: Set env vars
3440
run: |
3541
# There doesn't seem to be a way to map environment variables into other enviroments
@@ -62,8 +68,8 @@ jobs:
6268
- name: Login to Docker Hub as pulumi-bot
6369
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
6470
with:
65-
username: ${{ secrets.DOCKERHUB_USERNAME }}
66-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
71+
username: ${{ steps.esc-secrets.outputs.DOCKERHUB_USERNAME }}
72+
password: ${{ steps.esc-secrets.outputs.DOCKERHUB_PASSWORD }}
6773

6874
- name: Run Minio
6975
run: |
@@ -124,7 +130,7 @@ jobs:
124130
# The Slack webhook URL must be specific to the pulumi-service Slack channel.
125131
# The name of the Slack app is "Pulumi Webhooks". You must have access to it
126132
# to be able to see it on https://api.slack.com.
127-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
133+
SLACK_WEBHOOK_URL: ${{ steps.esc-secrets.outputs.SLACK_WEBHOOK_URL }}
128134
with:
129135
text: Minio integration test in pulumi-self-hosted-installers failed for service's latest edge build
130136
fields: job,workflow

0 commit comments

Comments
 (0)