Skip to content

Commit a719b30

Browse files
committed
use the new-style ESC action
1 parent b729be6 commit a719b30

File tree

6 files changed

+51
-15
lines changed

6 files changed

+51
-15
lines changed

.github/workflows/pr-tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
permissions:
1010
contents: read
11+
id-token: write
1112

1213
jobs:
1314
lint:

.github/workflows/publish-prerelease.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ on:
66
- v*.*.*-**
77

88
env:
9-
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
9+
ESC_ACTION_OIDC_AUTH: true
10+
ESC_ACTION_OIDC_ORGANIZATION: pulumi
11+
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
12+
ESC_ACTION_ENVIRONMENT: imports/github-secrets
13+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: GITHUB_TOKEN=PULUMI_BOT_TOKEN
1014

1115
permissions:
12-
contents: write # Needed to publish releases
13-
packages: write # If publishing packages
16+
contents: write # Needed to publish releases
17+
packages: write # If publishing packages
1418
id-token: write
1519
actions: read
1620
attestations: read

.github/workflows/publish-release.yaml

+15-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ on:
77
- '!v*.*.*-**'
88

99
env:
10-
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
10+
ESC_ACTION_OIDC_AUTH: true
11+
ESC_ACTION_OIDC_ORGANIZATION: pulumi
12+
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
13+
ESC_ACTION_ENVIRONMENT: imports/github-secrets
14+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: GITHUB_TOKEN=PULUMI_BOT_TOKEN
1115

1216
permissions:
13-
contents: write # Needed to publish releases
14-
packages: write # Needed for publishing packages
17+
contents: write # Needed to publish releases
18+
packages: write # Needed for publishing packages
1519
id-token: write
1620
actions: read
1721
attestations: read
@@ -47,6 +51,9 @@ jobs:
4751
name: s3 blobs
4852
runs-on: ubuntu-latest
4953
steps:
54+
- name: Fetch secrets from ESC
55+
id: esc-secrets
56+
uses: pulumi/esc-action@v1
5057
- name: Checkout Repo
5158
uses: actions/checkout@v3
5259
with:
@@ -60,7 +67,7 @@ jobs:
6067
role-duration-seconds: 3600
6168
role-external-id: upload-pulumi-release
6269
role-session-name: pulumi@githubActions
63-
role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }}
70+
role-to-assume: ${{ steps.esc-secrets.outputs.AWS_UPLOAD_ROLE_ARN }}
6471
- name: Download release artifacts
6572
run: |
6673
mkdir -p artifacts
@@ -82,14 +89,17 @@ jobs:
8289
- name: Dispatch docs workflow
8390
run-command: pulumictl create cli-docs-build "${{ github.ref_name }}" --event-type "esc-cli"
8491
steps:
92+
- name: Fetch secrets from ESC
93+
id: esc-secrets
94+
uses: pulumi/esc-action@v1
8595
- name: Checkout Repo
8696
uses: actions/checkout@v3
8797
with:
8898
ref: ${{ github.ref_name }}
8999
- name: Install Pulumictl
90100
uses: jaxxstorm/[email protected]
91101
env:
92-
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
102+
GITHUB_TOKEN: ${{ steps.esc-secrets.outputs.PULUMI_BOT_TOKEN }}
93103
with:
94104
repo: pulumi/pulumictl
95105
tag: v0.0.45

.github/workflows/publish-snapshot.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ on:
99
- 'README.md'
1010

1111
env:
12-
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
12+
ESC_ACTION_OIDC_AUTH: true
13+
ESC_ACTION_OIDC_ORGANIZATION: pulumi
14+
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
15+
ESC_ACTION_ENVIRONMENT: imports/github-secrets
16+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: GITHUB_TOKEN=PULUMI_BOT_TOKEN
1317

1418
permissions:
15-
contents: write # Needed to publish releases
16-
packages: write # If publishing packages
19+
contents: write # Needed to publish releases
20+
packages: write # If publishing packages
1721
id-token: write
1822
actions: read
1923
attestations: read

.github/workflows/stage-publish.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,25 @@ on:
88
type: string
99

1010
permissions:
11-
contents: write # Needed for publishing releases
12-
packages: write # Needed for publishing packages
11+
contents: write # Needed for publishing releases
12+
packages: write # Needed for publishing packages
13+
id-token: write
1314

1415
env:
15-
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
16+
ESC_ACTION_OIDC_AUTH: true
17+
ESC_ACTION_OIDC_ORGANIZATION: pulumi
18+
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
19+
ESC_ACTION_ENVIRONMENT: imports/github-secrets
20+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: GITHUB_TOKEN=PULUMI_BOT_TOKEN
1621

1722
jobs:
1823
publish:
1924
name: Publish
2025
runs-on: macos-latest
2126
steps:
27+
- name: Fetch secrets from ESC
28+
id: esc-secrets
29+
uses: pulumi/esc-action@v1
2230
- name: Checkout Repo
2331
uses: actions/checkout@v2
2432
- name: Unshallow clone for tags

.github/workflows/stage-test.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ on:
1717

1818
permissions:
1919
contents: read
20+
id-token: write
2021

2122
jobs:
2223
test:
2324
name: Test
2425
runs-on: ubuntu-latest
2526
steps:
27+
- name: Fetch secrets from ESC
28+
id: esc-secrets
29+
uses: pulumi/esc-action@v1
2630
- name: Checkout Repo
2731
uses: actions/checkout@v2
2832
with:
@@ -46,9 +50,14 @@ jobs:
4650
with:
4751
fail_ci_if_error: false
4852
verbose: true
49-
token: ${{ secrets.CODECOV_TOKEN }}
53+
token: ${{ steps.esc-secrets.outputs.CODECOV_TOKEN }}
5054
strategy:
5155
fail-fast: false
5256
matrix:
5357
go-version: [1.21.x, 1.23.x]
5458
go-stable: [true]
59+
env:
60+
ESC_ACTION_OIDC_AUTH: true
61+
ESC_ACTION_OIDC_ORGANIZATION: pulumi
62+
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
63+
ESC_ACTION_ENVIRONMENT: imports/github-secrets

0 commit comments

Comments
 (0)