Skip to main content
Use GitHub OpenID Connect (OIDC) to authenticate a trusted deployment job to HashiCorp Vault without storing a Vault token in GitHub. The job reads only the values required by one Checkly CLI project and exposes them to the Checkly deploy step. For guidance on choosing account, group, or check scope, see Manage secrets at scale.
  • A Checkly Monitoring as Code project with its dependencies and lockfile committed.
  • A GitHub repository with Actions enabled and a protected environment named checkly-production.
  • A Vault server reachable from the GitHub Actions runner, with the required values stored in a KV secrets engine.
  • Permission to configure a Vault JWT auth method, policy, and role.
  • VAULT_ADDR and CHECKLY_ACCOUNT_ID configured as GitHub Actions variables.
  • The Checkly API key stored in Vault alongside the secrets required by this CLI project.
This guide uses a fictional payments service; replace its names, paths, and URL with your own application values. Checkly requires CHECKLY_API_KEY and CHECKLY_ACCOUNT_ID; VAULT_ADDR configures this workflow.

Configure Vault access

Configure Vault’s JWT authentication for GitHub Actions and create a role for this deployment by following HashiCorp’s vault-action JWT guide. The workflow below assumes that role is named checkly-payments-deploy. Restrict the role to the repository, branch, and GitHub environment that deploy Checkly. Its policy should grant read-only access only to the Vault paths referenced by this project. The role’s audience must match jwtGithubAudience in the workflow. See HashiCorp’s JWT role reference for the Vault configuration options.

Scope secrets in your constructs

Read each value with secret() and mark it as secret on the group or check that needs it:
__checks__/payments.check.ts
The helper reads CHECKLY_SECRET_PAYMENTS_API_KEY and CHECKLY_SECRET_PAYMENTS_ADMIN_TOKEN when the CLI loads the project. If a required value is missing, secret() stops the deployment instead of deploying an empty value.

Fetch and deploy from GitHub Actions

The official HashiCorp action authenticates with GitHub’s OIDC token and returns masked step outputs. Set exportEnv: false, then map the outputs to CHECKLY_SECRET_* variables only on the deploy step:
.github/workflows/deploy-checkly.yml
The job needs id-token: write to request the GitHub OIDC token and contents: read for checkout. The Vault role and policy determine which values the job can read.
Do not print or persist fetched values. Install dependencies before fetching secrets and expose the outputs only to the Checkly deployment step.

Rotate a secret

Rotating a value in Vault does not automatically update the encrypted copy stored by Checkly. Run this trusted deployment workflow again after rotation. The action reads the current KV value and checkly deploy updates the secret at its declared group or check scope. When the workflow no longer needs a value, remove it from the construct, workflow mapping, and Vault policy or path.