Skip to content

Configuring OpenID Connect for GitHub ​

This document outlines the steps required to configure Pulumi Cloud to accept GitHub id_tokens and exchange them for Pulumi access tokens. Three token types are supported — organization, team, and personal — subject to your Pulumi edition.

INFO

This guide walks through the Pulumi Cloud console. You can also configure OIDC Issuers via the REST API or the OidcIssuer resource in the Pulumi Service provider.

Prerequisites ​

  • You must be an admin of your Pulumi organization.

WARNING

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 ​

The registration steps are the same for all token types.

  1. Navigate to Settings → Access Management → OIDC Issuers and select Register issuer.
  2. Name the issuer and set the issuer URL to https://token.actions.githubusercontent.com.
  3. Submit the form.

Find your subject claim prefix ​

GitHub uses one of two formats for the sub claim, depending on the repository. To get the prefix your repository uses, run:

bash
gh api repos/<owner>/<repo>/actions/oidc/customization/sub --jq .sub_claim_prefix

The prefix has one of these formats:

  • repo:<owner>@<owner-id>/<repo>@<repo-id>: the immutable subject claim. Repositories created, renamed, or transferred after July 15, 2026 use this format by default.
  • repo:<organization>/<repo>: the previous format.

In a policy, add :* to the end of the prefix to match every workflow in the repository. For example, repo:octo-org@123456/octo-repo@789012:*.

Organization tokens ​

Organization tokens grant access on behalf of the entire Pulumi organization. They are appropriate for CI/CD pipelines that need broad access across stacks in the organization.

Authorization policy ​

  1. Select the issuer name.

  2. Set Decision to Allow.

  3. Set Token type to Organization.

  4. Add a policy and configure the audience and subject claims for your organization and repositories:

    • Aud: urn:pulumi:org:<org-name>
    • Sub: <sub-claim-prefix>😗, where <sub-claim-prefix> is your repository's subject claim prefix

    For more information about GitHub token claims, see the official GitHub documentation.

  5. Select Save policies.

GitHub Actions step ​

yaml
      - uses: pulumi/auth-actions@v2
        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 workflow ​

yaml
name: Pulumi preview
on:
  workflow_dispatch:

permissions:
  id-token: write
  contents: read

jobs:
  run_cron_job:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v7

      - uses: pulumi/auth-actions@v2
        with:
          organization: org-name
          requested-token-type: urn:pulumi:token-type:access_token:organization

      - uses: pulumi/actions@v7
        with:
          command: preview
          stack-name: org-name/stack-name

Team tokens ​

Team tokens are scoped to a specific team within your Pulumi organization. They are useful when you want to limit CI/CD access to only the stacks a particular team is authorized to manage.

Authorization policy ​

  1. Select the issuer name.

  2. Set Decision to Allow.

  3. Set Token type to Team and set Scope to team:<team-slug>, where <team-slug> is the slug of the team within your Pulumi organization.

  4. Add a policy and configure the audience and subject claims:

    • Aud: urn:pulumi:org:<org-name>
    • Sub: <sub-claim-prefix>😗, where <sub-claim-prefix> is your repository's subject claim prefix
  5. Select Save policies.

GitHub Actions step ​

yaml
      - uses: pulumi/auth-actions@v2
        with:
          organization: org-name
          requested-token-type: urn:pulumi:token-type:access_token:team
          scope: team:<team-slug>

Replace org-name with your Pulumi organization name and <team-slug> with the team's slug.

Sample workflow ​

yaml
name: Pulumi preview
on:
  workflow_dispatch:

permissions:
  id-token: write
  contents: read

jobs:
  run_cron_job:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v7

      - uses: pulumi/auth-actions@v2
        with:
          organization: org-name
          requested-token-type: urn:pulumi:token-type:access_token:team
          scope: team:<team-slug>

      - uses: pulumi/actions@v7
        with:
          command: preview
          stack-name: org-name/stack-name

Personal tokens ​

Personal tokens are issued on behalf of a specific Pulumi user and carry that user's permissions. For most automated workflows, organization or team tokens are preferred because they run with organizational identity and do not depend on an individual account. Personal tokens are available on all Pulumi editions and are appropriate when you want a workflow to operate with exactly the access that a particular user has been granted.

Authorization policy ​

  1. Select the issuer name.

  2. Set Decision to Allow.

  3. Set Token type to Personal and set Scope to user:, where `` is the Pulumi username of the user the token should represent.

  4. Add a policy and configure the audience and subject claims:

    • Aud: urn:pulumi:org:<org-name>
    • Sub: <sub-claim-prefix>😗, where <sub-claim-prefix> is your repository's subject claim prefix
  5. Select Save policies.

GitHub Actions step ​

yaml
      - uses: pulumi/auth-actions@v2
        with:
          organization: org-name
          requested-token-type: urn:pulumi:token-type:access_token:personal
          scope: user:<pulumi-username>

Replace org-name with your Pulumi organization name and `` with the Pulumi username.

Sample workflow ​

yaml
name: Pulumi preview
on:
  workflow_dispatch:

permissions:
  id-token: write
  contents: read

jobs:
  run_cron_job:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v7

      - uses: pulumi/auth-actions@v2
        with:
          organization: org-name
          requested-token-type: urn:pulumi:token-type:access_token:personal
          scope: user:<pulumi-username>

      - uses: pulumi/actions@v7
        with:
          command: preview
          stack-name: org-name/stack-name

Content from the official Pulumi documentation (github.com/pulumi/docs).