Skip to content

Commit cd56874

Browse files
authored
Add workflow to export repo secrets
This repository has repository-specific secrets that need to be migrated to ESC. These changes add a GitHub Actions workflow to perform this migration. The workflow is configured to be run manually. It is only expected that the worflow will be run once. The workflow uses https://github.com/pulumi/esc-export-secrets-action to create a new ESC environment to hold the repository's secrets. This environment also imports the environment that holds the organization's secrets.
1 parent 1a0bfd1 commit cd56874

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
permissions: write-all # Equivalent to default permissions plus id-token: write
2+
name: Export secrets to ESC
3+
on: [ workflow_dispatch ]
4+
jobs:
5+
export-to-esc:
6+
runs-on: ubuntu-latest
7+
name: export GitHub secrets to ESC
8+
steps:
9+
- name: Generate a GitHub token
10+
id: generate-token
11+
uses: actions/create-github-app-token@v1
12+
with:
13+
app-id: 1256780 # Export Secrets GitHub App
14+
private-key: ${{ secrets.EXPORT_SECRETS_PRIVATE_KEY }}
15+
- name: Export secrets to ESC
16+
uses: pulumi/esc-export-secrets-action@v1
17+
with:
18+
organization: pulumi
19+
org-environment: imports/github-secrets
20+
exclude-secrets: EXPORT_SECRETS_PRIVATE_KEY
21+
github-token: ${{ steps.generate-token.outputs.token }}
22+
oidc-auth: true
23+
oidc-requested-token-type: urn:pulumi:token-type:access_token:organization
24+
env:
25+
GITHUB_SECRETS: ${{ toJSON(secrets) }}

0 commit comments

Comments
 (0)