OB-357 sub-task 3d — GitHub Action that authenticates a workflow with Observo via OIDC and creates a test run.
Use it instead of manually plumbing an OBSERVO_API_KEY secret + observo run create shell steps. It mints a short-lived OIDC token, exchanges it for an Observo session, opens a run, and exports OBSERVO_RUN_KEY / OBSERVO_TOKEN env vars for subsequent steps.
- Install the Observo for GitHub App on your org / user account (github.com/apps/observo-ai).
- After install, visit
observoai.co/install/completewhile logged into Observo to bind the installation to your account. - Your workflow must request the
id-token: writepermission (composite actions can't grant it for you).
name: Observo E2E
on: [pull_request, push]
jobs:
e2e:
runs-on: ubuntu-latest
permissions:
id-token: write # required for OIDC
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- uses: observo-ai/setup@v1
with:
plan: E2E-MAIN
- run: npm ci
- run: npx playwright install --with-deps
- run: npx playwright test
# Reporter picks up OBSERVO_RUN_KEY automatically.
- name: Finalize Observo run
if: always()
run: |
curl -sS -X POST \
-H "Authorization: Bearer $OBSERVO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status":"auto"}' \
"${API_BASE:-https://api.observoai.co}/api/runs/$OBSERVO_RUN_KEY:finish"| Name | Required | Default | Description |
|---|---|---|---|
plan |
✅ | — | Observo plan key for the run (e.g. E2E-MAIN). |
api-base-url |
— | https://api.observoai.co |
Override for self-hosted / staging deployments. |
audience |
— | https://api.observoai.co |
OIDC aud claim. Must match the Observo backend's expected audience. |
run-name |
— | <workflow> #<run-number> |
Human-readable name for the run row in Observo. |
| Name | Description |
|---|---|
run-key |
The OBSERVO_RUN_KEY for this run. Also written to $GITHUB_ENV. |
session-token |
Short-lived Observo PASETO. Also exported as OBSERVO_TOKEN. |
- Mint OIDC token — calls the GitHub Actions OIDC issuer endpoint (
ACTIONS_ID_TOKEN_REQUEST_URL) with the configured audience. - Exchange for session —
POST /api/auth/oidc/exchangeon the Observo backend, which verifies the JWT against the GitHub Actions JWKS, mapsrepository_owner_id→ Observo account viagithub_app_installations, and returns a 1-hour PASETO. - Create run —
POST /api/runswith plan key + commit / branch / CI run URL derived fromGITHUB_*env. - Export env —
OBSERVO_RUN_KEY,OBSERVO_TOKEN,OBSERVO_ACCOUNT_IDwritten to$GITHUB_ENVfor downstream steps.
The Observo Playwright reporter (@observo/playwright-reporter) automatically attaches to an existing run when OBSERVO_RUN_KEY is set — no extra configuration required.
Pin to a major version tag in production:
- uses: observo-ai/setup@v1We follow semver. Breaking changes bump the major; new features bump the minor. Patches are auto-tagged from main.
- uses: observo-ai/setup@v1
with:
plan: E2E-MAIN
api-base-url: https://observo.acme.internal
audience: https://observo.acme.internalThe audience must match the Observo backend's OBSERVO_API_BASE_URL config.
"Missing OIDC token request env" — your workflow lacks permissions: { id-token: write }. Add it at the job level.
"OIDC exchange failed: ... no account mapping" — the GitHub App is installed but not yet bound to your Observo account. Visit observoai.co/install/complete while logged in.
"OIDC exchange failed: ... invalid OIDC token" — most often, the audience input doesn't match the Observo backend's expected audience. Default is https://api.observoai.co.
MIT — see LICENSE.