Skip to content

Comments

Use ESC secrets#847

Open
pgavlin wants to merge 1 commit intomainfrom
pgavlin/esc-secrets
Open

Use ESC secrets#847
pgavlin wants to merge 1 commit intomainfrom
pgavlin/esc-secrets

Conversation

@pgavlin
Copy link
Member

@pgavlin pgavlin commented Jul 24, 2025

These changes migrate this repo's GitHub Actions Workflows to use ESC secrets instead of GitHub Secrets.

The changes are largely mechanical:

  • Common configuration for all ESC actions within a workflow is added to the workflow's environment variables
  • Permissions are expanded as necessary for workflows that do not grant id-token: write permissions
    • read-all permissions are replaced with the union of all explicit read permissions and id-token: write
    • Default permissions are replaced with write-all, which is the equivalent of all explicit write permissions and
      id-token: write
    • Explicit permissions are modified to grant id-token: write
  • A step that fetches ESC secrets and populates environment variables is added to each step that reads secrets
  • Direct references to secrets within the job are replaced with references to the step's outputs

All ESC actions are configured to fetch secrets from a shared ESC environment that contains secrets migrated from GitHub Actions. The ESC action performs its own OIDC exchange to obtain a Pulumi Access Token.

@pgavlin pgavlin requested a review from a team as a code owner July 24, 2025 17:33
@pgavlin pgavlin force-pushed the pgavlin/esc-secrets branch from fc45dd0 to 9a3c360 Compare July 24, 2025 18:07
Comment on lines 39 to +48
secrets:
PULUMI_ACCESS_TOKEN: { required: false }
AWS_ACCESS_KEY_ID: { required: false }
AWS_SECRET_ACCESS_KEY: { required: false }
AWS_CI_ROLE_ARN: { required: false }
ARM_CLIENT_ID: { required: false }
ARM_CLIENT_SECRET: { required: false }
ARM_SUBSCRIPTION_ID: { required: false }
ARM_TENANT_ID: { required: false }
CODECOV_TOKEN: { required: false }

PULUMI_ACCESS_TOKEN: {required: false}
AWS_ACCESS_KEY_ID: {required: false}
AWS_SECRET_ACCESS_KEY: {required: false}
AWS_CI_ROLE_ARN: {required: false}
ARM_CLIENT_ID: {required: false}
ARM_CLIENT_SECRET: {required: false}
ARM_SUBSCRIPTION_ID: {required: false}
ARM_TENANT_ID: {required: false}
CODECOV_TOKEN: {required: false}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this whole section can now be deleted, instead of just changing the formatting?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely so. These changes are tool-generated, though, so I'd prefer to take that as a follow-up if that's alright.

These changes migrate this repo's GitHub Actions Workflows to use ESC secrets instead of GitHub Secrets.

The changes are largely mechanical:

- Common configuration for all ESC actions within a workflow is added to the workflow's environment variables
- Permissions are expanded as necessary for workflows that do not grant `id-token: write` permissions
	- `read-all` permissions are replaced with the union of all explicit read permissions and `id-token: write`
	- Default permissions are replaced with `write-all`, which is the equivalent of all explicit write permissions and
	  `id-token: write`
	- Explicit permissions are modified to grant `id-token: write`
- A step that fetches ESC secrets and populates environment variables is added to each step that reads secrets
- Direct references to secrets within the job are replaced with references to the step's outputs

All ESC actions are configured to fetch secrets from a shared ESC environment that contains secrets migrated from GitHub Actions. The ESC action performs its own OIDC exchange to obtain a Pulumi Access Token.
@pgavlin pgavlin force-pushed the pgavlin/esc-secrets branch from 9a3c360 to 4869661 Compare July 25, 2025 17:08
@pgavlin pgavlin added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact/no-changelog-required This issue doesn't require a CHANGELOG update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants