Skip to content
Weik.ioDocs
2026.2
Try Weik.io

Keep integrations in Git

Weik.io 2026.2

Plan and apply each change with the weikio CLI in a pipeline, and promote to production through a pull request behind required reviewers. Product page · Video

Watch: An integration in a Git repository, 4:21

The video keeps an integration in a Git repository and applies it from there after a plan.

On this page

A pipeline in GitHub Actions plans each change to your Weik.io files in its pull request and applies it after the merge. Secret values stay out of Git, as do users and API keys.

The pipeline pushes changes#

The pipeline runs the weikio CLI, so Weik.io needs no Git credentials and no network path to your Git host, even when Weik.io runs inside your network. Weik.io doesn’t poll the repository, so a change a person makes with the CLI lasts until the pipeline applies again.

The repository#

A repository can have all your projects, or you can keep one per project.

weikio-integrations
weikio-integrations/
  .github/workflows/
    plan.yaml                   pull request: what would change, as a comment
    devtest.yaml                merge to main: apply to devtest
    production.yaml             merge to main: apply to production, behind approval
  finance/
    project.yaml                admin key: the project is created once
    variables/erp-url.yaml      admin key: a default applies to every environment
    shared/                     what every environment reads, which the devtest job applies
      erp-invoice-export/       the integration directory
      events/                   channels, sources, subscriptions
      apis/                     APIs and their versions
    devtest/                    the devtest job applies it
      variables/
      apis/                     API deployments and subscriptions of devtest
      deployments/erp-invoice-export.yaml         version: 1.1.0
    production/                 the production job applies it
      variables/erp-url.yaml
      apis/
      deployments/erp-invoice-export.yaml         version: 1.0.0

A deployment document says only what should run where:

finance/production/deployments/erp-invoice-export.yaml
apiVersion: weik.io/v1
kind: deployment
metadata: { name: erp-invoice-export, project: finance, environment: production }
spec: { version: 1.0.0, state: started }

The loop#

  1. A developer edits the integration and runs it on their machine with weikio dev run.
  2. The developer raises the version in integration.yaml and opens a pull request.
  3. The pull request workflow runs weikio diff with the devtest key and posts its output as a comment. Files changed without a raised version show as a would refuse row, so the check fails before anyone merges.
  4. On merge, the devtest workflow applies shared/ and devtest/ to devtest in one call. Weik.io builds each changed integration once, in this step. The other environments deploy the versions it built.
  5. A promotion is a pull request that changes the version in finance/production/deployments/erp-invoice-export.yaml. On merge, the production workflow plans in a separate job. Its apply job runs only after GitHub’s required reviewers have read that plan and approved it.
  6. A rollback is a git revert of the promotion, merged through the same review and approval. The revert returns to a version that already exists, so Weik.io deploys it without a build.

The plan comment on a pull request lists what the apply would do:

  • The versions it would create
  • The variables that change
  • The deployments that move
  • What it would delete

A change starts in a folder in Git. A pull request runs weikio diff, and the pipeline posts the plan as a comment. The merge runs weikio apply and the change reaches devtest. Promoting a tested version to production is a pull request that changes the version, and production applies it after the repository's required reviewers approve. git revert rolls a change back through the same steps.

The loop from the folder in Git to production, and git revert back through the same steps.

The production workflow#

  • The plan job runs in the GitHub environment production-plan, which has the production key and no reviewers. The reviewers read its diff before they approve.
  • The apply job runs in the GitHub environment production, whose required reviewers approve it.

Both jobs install a pinned release of the CLI and set the commit’s subject line as the reason for the change:

.github/workflows/production.yaml
name: production
on:
  push:
    branches: [main]
    paths: ['finance/**']
env:
  WEIKIO_SERVER: https://weikio.example.com
jobs:
  plan:
    runs-on: ubuntu-latest
    environment: production-plan
    env:
      WEIKIO_API_KEY: ${{ secrets.WEIKIO_API_KEY }}
    steps:
      - uses: actions/checkout@v4
      - run: |
          curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.4 sh
          echo "$HOME/.local/bin" >> "$GITHUB_PATH"
          echo "WEIKIO_REASON=$(git log -1 --format=%s)" >> "$GITHUB_ENV"
      - run: weikio diff -f ./finance/production --env production --prune finance || [ $? -eq 2 ]
  apply:
    needs: plan
    runs-on: ubuntu-latest
    environment: production
    env:
      WEIKIO_API_KEY: ${{ secrets.WEIKIO_API_KEY }}
    steps:
      - uses: actions/checkout@v4
      - run: |
          curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.4 sh
          echo "$HOME/.local/bin" >> "$GITHUB_PATH"
          echo "WEIKIO_REASON=$(git log -1 --format=%s)" >> "$GITHUB_ENV"
      - run: printf '%s' "$ERP_API_KEY" | weikio secret set finance/erp-api-key --env production -y
        env:
          ERP_API_KEY: ${{ secrets.ERP_API_KEY }}
      - run: weikio apply -f ./finance/production --env production --prune finance -y

The plan step accepts exit code 2, which weikio diff returns when something changes, so the plan job fails only on a refusal or an error. Drift and export lists every exit code.

The devtest and plan workflows#

The devtest workflow is one job with the devtest key and no reviewers. It applies the shared folder and devtest’s folder together:

.github/workflows/devtest.yaml
name: devtest
on:
  push:
    branches: [main]
    paths: ['finance/**']
env:
  WEIKIO_SERVER: https://weikio.example.com
jobs:
  apply:
    runs-on: ubuntu-latest
    environment: devtest
    env:
      WEIKIO_API_KEY: ${{ secrets.WEIKIO_API_KEY }}
    steps:
      - uses: actions/checkout@v4
      - run: |
          curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.4 sh
          echo "$HOME/.local/bin" >> "$GITHUB_PATH"
          echo "WEIKIO_REASON=$(git log -1 --format=%s)" >> "$GITHUB_ENV"
      - run: weikio apply -f ./finance/shared -f ./finance/devtest --env devtest --prune finance -y

The plan workflow runs the same paths through weikio diff on every pull request and posts the result as a comment:

.github/workflows/plan.yaml
name: plan
on:
  pull_request:
    paths: ['finance/**']
permissions:
  contents: read
  pull-requests: write
env:
  WEIKIO_SERVER: https://weikio.example.com
jobs:
  plan:
    runs-on: ubuntu-latest
    environment: devtest
    env:
      WEIKIO_API_KEY: ${{ secrets.WEIKIO_API_KEY }}
      GH_TOKEN: ${{ github.token }}
    steps:
      - uses: actions/checkout@v4
      - run: |
          curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.4 sh
          echo "$HOME/.local/bin" >> "$GITHUB_PATH"
      - run: weikio diff -f ./finance/shared -f ./finance/devtest --env devtest --prune finance > plan.txt || [ $? -eq 2 ]
      - if: always()
        run: gh pr comment ${{ github.event.pull_request.number }} --body-file plan.txt

A route step that isn’t valid Camel gets through the plan, but the build in the devtest apply finds it.

Production is planned after the merge, because only a job that main reaches has the production key.

Keys#

Each repository has one API key per environment, kept as a GitHub environment secret. The key has the deployer role on the repository’s projects, limited to that environment, so the devtest key can’t change production even when someone edits the workflow file.

When several teams share one installation with a project each, a key for finance can’t apply hr/. A key administers the platform only when it was created with --platform-admin.

A deployer key can’t write a project or a default variable or secret. The project belongs to a platform administrator, who creates it once. A default variable or secret has no environment and changes every environment. A separate workflow with an admin key applies the defaults with weikio apply -f ./finance/variables --prune finance -y, which has no --env.

Secrets#

The {{name}} placeholders in the files show which secrets an integration needs. When a deployment needs a secret that has no value in its environment, the plan fails with secret_missing. Set an environment’s first value by hand before the first delivery that needs it:

Terminal
$ printf '%s' "$ERP_PROD_KEY" | weikio secret set finance/erp-api-key --env production

From then on, the apply job sets the value from a GitHub secret before it applies, as the production workflow above does. A changed value then goes through the same approval as every other change.

What Weik.io records#

When the CLI runs an apply in a pipeline, it records the commit the apply came from and that commit’s repository and branch. It gets them from the variables that GitHub Actions, GitLab CI and Azure DevOps set, or from --origin. weikio describe integration finance/erp-invoice-export shows them as applied from weikio-integrations@a1b2c3d.

In the audit log, a change from the pipeline links to its commit and has the commit’s subject line as its reason.

/settings/audit
The Audit log filtered to deployment changes. Anna Virtanen made the version changes in devtest and production and gave a reason for each.The Audit log filtered to deployment changes. Anna Virtanen made the version changes in devtest and production and gave a reason for each.The Audit log filtered to deployment changes. Anna Virtanen made the version changes in devtest and production and gave a reason for each.The Audit log filtered to deployment changes. Anna Virtanen made the version changes in devtest and production and gave a reason for each.
In the Audit log, you see each change with the person who made it and the reason they gave. You also see the matching weikio audit query line.

Sign in to the live demo

Sign in with the shared viewer account. It can open every screen of the example projects but can't change anything.

E-mail
viewer@demo.weik.io
Password
try-weikio-live-demo
Open the live demo