ReferenceIntegrations

CI authentication

How the Endform CLI authenticates in CI, with GitHub Actions OIDC through the Endform GitHub App or an organization API key in ENDFORM_API_KEY.

The Endform CLI authenticates in CI in one of two ways: through GitHub Actions OIDC with the Endform GitHub App, or with an organization API key stored in ENDFORM_API_KEY.

Interactive browser login (endform login) is disabled in CI environments.

Authentication methods

MethodSupported CI providersSetupBest for
GitHub App + OIDCGitHub ActionsInstall the Endform GitHub App and grant id-token: writeGitHub Actions workflows, zero static secrets, and Vercel preview checks
ENDFORM_API_KEYAny CI provider (GitHub Actions, GitLab CI, CircleCI, Azure Pipelines, Bitbucket, Buildkite)Create a key and store it as a masked CI secretNon-GitHub CI, repos where you cannot install GitHub Apps, or running MCP/analytics CLI commands in CI

GitHub Actions OIDC

When a GitHub Actions job grants id-token: write and the repository has the Endform GitHub App installed, npx endform@latest test requests a short-lived OIDC token from GitHub and exchanges it with Endform automatically.

.github/workflows/endform-e2e.yml
permissions:
  contents: read
  id-token: write
  • No secret to rotate: OIDC tokens are minted per job and expire automatically.
  • Keep contents: read: Adding a permissions block in GitHub Actions restricts all unlisted scopes, so include contents: read for actions/checkout.
  • Required for Vercel previews: The endformdev/actions/run-with-vercel-deployment action authenticates exclusively through GitHub OIDC.
  • Suite runs only: GitHub OIDC credentials are scoped to running tests and reporting check status. Commands that read historical analytics, inspect test attempts, manage quarantine rules, or run the local MCP server in CI (for example in an automated triage job) require ENDFORM_API_KEY.

API key (ENDFORM_API_KEY)

Set ENDFORM_API_KEY as a masked secret in your CI provider to authenticate any Endform CLI command without interactive login.

Create a key from the CLI and pipe it directly into your CI provider's secret store so the raw key is never printed to your terminal:

npx endform@latest api-key create --name "GitHub Actions" | gh secret set ENDFORM_API_KEY

For GitLab CI:

npx endform@latest api-key create --name "GitLab CI" | glab variable set ENDFORM_API_KEY --masked

You can also create and revoke keys in the Endform dashboard under Settings → API keys. See API keys for key management and lifecycle details.

Credential precedence and organization selection

When the CLI runs in CI, it resolves credentials and organizations in this order:

  1. ENDFORM_API_KEY environment variable: If set, the CLI uses the API key and runs against the organization that owns the key.
  2. GitHub Actions OIDC: If ENDFORM_API_KEY is not set and the job exposes GitHub's OIDC environment (id-token: write), the CLI authenticates through the repository's Endform GitHub App installation.

If your endform.config.ts specifies an organizationId (or you pass --organization-id), the authenticated credential must have access to that organization, otherwise the run fails with an authorization error.

Last updated