Skip to main content
Docs
Blog Status Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

GitHub Actions

To use an OIDC configuration in GitHub you’ll need to use the emulator-wtf/actions/configure-credentials@v1.0.0 GitHub action.

The action needs id-token: write permission to generate the OIDC token. If you previously had no permissions: section in your workflow file at all you’ll probably also want to add the contents: read permission, otherwise repository checkout will fail.

With the permission set, invoke the action with the oidc-configuration-id you got when creating the OIDC configuration in emulator.wtf UI:

- uses: emulator-wtf/actions/configure-credentials@v1.0.0
  with:
    oidc-configuration-id: **OIDC-CONFIGURATION-ID-GOES-HERE**

After invoking that action a temporarily valid EW_API_TOKEN will be set and you’ll be able to use ew-cli, the emulator.wtf Gradle plugin or our GitHub actions without having to explicitly set the token.

A full example GitHub workflow using OIDC with emulator.wtf:

name: Test workflow
permissions:
  contents: read
  id-token: write
on:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-java@v5
        with:
          distribution: 'zulu'
          java-version: '24'
      - uses: emulator-wtf/actions/configure-credentials@v1.0.0
        with:
          oidc-configuration-id: **OIDC-CONFIGURATION-ID-GOES-HERE**
      - run: ./gradlew testWithEmulatorWtf