Connect your stack

Run Veriom in CI

Record deployments from GitHub Actions without storing a token, check pull requests, and run the architecture check on GitLab or Bitbucket.

This page is for the person who looks after a repository's CI. It shows how to add Veriom to GitHub Actions with no stored secret, how to check pull requests, and how to use Veriom on GitLab CI or Bitbucket Pipelines.

Before you start

  • The repository is connected to Veriom through the GitHub App. See Connect a repository.
  • The repository has finished at least one audit, so Veriom knows its services.
  • You have the Admin or Owner role in the workspace.

Set up keyless CI in one click

  1. In Veriom, open Integrations and select the Repositories tab.
  2. On the repository's row, click Set up keyless CI.
  3. If Veriom asks you to confirm your identity, confirm it. This action needs a recent sign-in check.
  4. Veriom shows Draft pull request opened. Click Open #<number> to see it on GitHub.
  5. Review the pull request on GitHub and merge it. Veriom never merges it for you.

After the merge, every push to the default branch records a deployment of each service in Veriom. You see them under Architecture in the Services tab.

If a setup pull request is already open, Veriom shows Draft pull request already open and links to it instead of opening a second one.

What the setup pull request adds

The pull request is titled Record deployments in Veriom (keyless). It is opened as a draft from the branch veriom/ci-setup and adds one file, .github/workflows/veriom.yml:

.github/workflows/veriom.yml
name: Veriom
on:
  push:
    branches: ["main"]
permissions:
  contents: read
  id-token: write
jobs:
  deployment-record:
    runs-on: ubuntu-latest
    steps:
      - name: "Record the checkout-api deployment"
        uses: Veriom/actions/deployment-record@v2
        with:
          api-url: https://api.veriom.ai
          workspace-id: 7f3c9a52-1b4e-4d8a-9c61-2e5f0a7b8d13
          service-id: 3c2b1a09-8f7e-4d6c-b5a4-938271605f4e
          environment: production

Veriom fills in your default branch, workspace ID, and one step per service. Two things to check before you merge:

  • The file lists at most 10 services. Add a step for each extra service.
  • Every step records the production environment. Change environment if this branch deploys somewhere else.

How keyless sign-in works

The workflow holds no Veriom token. Each run proves which repository it comes from instead:

  1. id-token: write lets the job ask GitHub for a signed OIDC token with the audience veriom.
  2. The action sends that token to Veriom, which checks GitHub's signature, the issuer, and the expiry.
  3. Veriom accepts it only when the repository is connected through the GitHub App in your workspace, is enabled, and belongs to the account that installed the App.
  4. Veriom returns a short-lived workspace token. It lasts 15 minutes by default and each GitHub token can be exchanged once.

That token works only for its own repository. It can start and read audits, record deployments, and send cloud inventory. Any other request gets 403 ci_token_route_not_allowed.

Check pull requests on GitHub

The GitHub App can post a check on each pull request. It needs no workflow file. This check is off until you turn it on:

  1. Open Audits, select the Schedules tab, then the GitHub events tab.
  2. Click Edit on the repository's policy. Veriom created it when you connected the repository.
  3. Under Listen for, select Pull request checks.
  4. Click Save policy.

The next time a pull request opens or changes, Veriom audits it and posts a check named Veriom architecture guard. The check result follows the release gate:

Release gate resultGitHub check result
Blocks the releaseFailure
Needs review, or not enough evidenceAction required
Shadow mode, unavailable, or turned offNeutral
PassesSuccess
Passes, on the first run with no earlier audit to compareNeutral

To make the check a merge gate, add Veriom architecture guard as a required status check in your GitHub branch protection rule.

The App needs the Pull requests: read and Checks: write permissions to post the check. If it lacks them, Veriom records a github.architecture_check.permission_required event in the Activity log and posts nothing.

Check merge requests on GitLab or Bitbucket

GitLab CI and Bitbucket Pipelines have no keyless option. They use a workspace API token.

  1. Create a token under Settings → API tokens with the audits:read, audits:write, and repositories:read scopes. See API tokens.

  2. Copy the check into your repository:

    git clone https://github.com/Veriom/actions.git veriom-actions
    ./veriom-actions/install-architecture-check.sh gitlab /path/to/your/repository

    Use bitbucket instead of gitlab for Bitbucket. The script writes .veriom/architecture-check.cjs and .veriom/gitlab-architecture-check.yml.

  3. On GitLab, include the template from .gitlab-ci.yml:

    .gitlab-ci.yml
    include:
      - local: .veriom/gitlab-architecture-check.yml

    On Bitbucket, copy the step from .veriom/bitbucket-architecture-check.yml into bitbucket-pipelines.yml.

  4. Store the token as the VERIOM_API_TOKEN CI variable. On GitLab, make it Masked but not Protected. Merge request pipelines run on unprotected branches and cannot read protected variables.

The job fails when the result is review, blocked, or insufficient_evidence. Set VERIOM_FAIL_ON to change that list, or to none to never fail.

The actions

All three actions live in Veriom/actions.

ActionWhat it doesRequired inputs
Veriom/actions/deployment-record@v2Records a deployment of one service for the current commitservice-id, environment
Veriom/actions/architecture-check@v2Audits the pull request commit and fails the job on the outcomes in fail-onNone
Veriom/actions/cloud-collector@v2Sends a read-only cloud inventory. See Connect your cloudprovider, api-token

api-url defaults to https://api.veriom.ai/v1. The actions find the workspace, repository, and commit from the token and the CI run, so you rarely set workspace-id, repository-id, or commit-sha.

If something goes wrong

Message or codeWhat it meansFix
ci_setup_no_servicesVeriom has not found a service in this repository yetRun an audit, then try again
ci_setup_permission_missingThe GitHub App cannot write the workflowGrant the App Contents, Workflows, and Pull requests write access in GitHub
ci_setup_installation_unavailableThe GitHub App is suspended or removedReinstall the App, then reconnect the repository
ci_setup_github_onlyThe repository is not on GitHubUse the GitLab or Bitbucket steps above
ci_oidc_repository_not_connectedThe run's repository is not connected to a workspace, or is out of scopeConnect it, or click Add to scope on it in Integrations → Repositories
ci_oidc_workspace_ambiguousThe repository is connected to more than one workspaceSet workspace-id on the action
ci_oidc_token_reusedThe same GitHub token was exchanged twiceRe-run the job
ci_token_repository_mismatchThe step tried to act on another repositoryRemove repository-id, or point it at this repository

See Troubleshooting for more codes.

Was this guide useful?

Your response stays in this browser unless you open a GitHub issue.
View source