Skip to content

Use ESC secrets #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
permissions: write-all # Equivalent to default permissions plus id-token: write
env:
ESC_ACTION_OIDC_AUTH: true
ESC_ACTION_OIDC_ORGANIZATION: pulumi
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
ESC_ACTION_ENVIRONMENT: imports/github-secrets
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: false
on:
pull_request:

pull_request: null
name: PR test

jobs:
Expand All @@ -9,21 +15,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Fetch secrets from ESC
id: esc-secrets
uses: pulumi/esc-action@v1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Login to Docker Hub as pulumi-bot
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
username: ${{ steps.esc-secrets.outputs.DOCKERHUB_USERNAME }}
password: ${{ steps.esc-secrets.outputs.DOCKERHUB_PASSWORD }}

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

Expand All @@ -34,4 +43,3 @@ jobs:
name: service-log
path: ${{ env.SERVICE_LOG }}
overwrite: true

26 changes: 16 additions & 10 deletions .github/workflows/test-with-minio.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
permissions: write-all # Equivalent to default permissions plus id-token: write
env:
ESC_ACTION_OIDC_AUTH: true
ESC_ACTION_OIDC_ORGANIZATION: pulumi
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
ESC_ACTION_ENVIRONMENT: imports/github-secrets
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: false
# workflow_dispatch allows for manual triggering from the GitHub Actions UI, as well
# as the API. repository_dispatch allows us to trigger multiple workflows that
# match on an event_type parameter when triggered via an API call.
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
pull_request:
workflow_dispatch:

pull_request: null
workflow_dispatch: null
repository_dispatch:
types: [integration_tests]

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

steps:
- name: Fetch secrets from ESC
id: esc-secrets
uses: pulumi/esc-action@v1
- name: Set env vars
run: |
# There doesn't seem to be a way to map environment variables into other enviroments
Expand Down Expand Up @@ -62,8 +68,8 @@ jobs:
- name: Login to Docker Hub as pulumi-bot
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
username: ${{ steps.esc-secrets.outputs.DOCKERHUB_USERNAME }}
password: ${{ steps.esc-secrets.outputs.DOCKERHUB_PASSWORD }}

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