Configuring OpenID Connect for GitHub
This document outlines the steps required to configure Pulumi Cloud to accept GitHub id_tokens and exchange them for organization access tokens.
This guide walks through the Pulumi Cloud UI. You can also configure OIDC Issuers via the REST API or the
OidcIssuer resource in the Pulumi Service provider.This guide demonstrates using
organization tokens. Depending on your Pulumi edition, you can also use personal or team tokens by adjusting the token type in the authorization policies and the requested-token-type parameter.Prerequisites
- You must be an admin of your Pulumi organization.
This guide provides step-by-step instructions based on the official provider documentation, which is subject to change. For the most current information, refer to the official GitHub documentation.
Register the OIDC Issuer
- Navigate to Settings → Access Management → OIDC Issuers and select Register issuer.
- Name the issuer and set the issuer URL to
https://token.actions.githubusercontent.com. - Submit the form.
Configure the authorization policies
Select the issuer name.
Set Decision to Allow.
Set Token type to Organization.
Add a policy to allow OIDC and configure the audience and subject claims for your organization and repositories:
- Aud:
urn:pulumi:org:<org-name> - Sub:
repo:<organization>/<repo>:*
For more information about GitHub token claims, see the official GitHub documentation.
- Aud:
Select Save policies.
Set up GitHub Actions to use Pulumi’s authentication action
- uses: pulumi/auth-actions@v1
with:
organization: org-name
requested-token-type: urn:pulumi:token-type:access_token:organization
Replace org-name with your Pulumi organization name. For more information, see the Pulumi Auth Action documentation.
Sample GitHub Actions workflow
name: Pulumi preview
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
run_cron_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pulumi/auth-actions@v1
with:
organization: org-name
requested-token-type: urn:pulumi:token-type:access_token:organization
- uses: pulumi/actions@v6
with:
command: preview
stack-name: org-name/stack-name
Thank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.