GitHub action for running omnictl commands
Find a file
jdmcmahan 88ed6f4735
Merge pull request #102 from jdmcmahan/renovate/mcmahan-omnictl-1.x
feat(deps): update mcmahan/omnictl docker tag to v1.9.3
2026-07-16 16:06:53 -05:00
.github chore(deps): update thenativeweb/get-next-version action to v2.7.4 2026-07-10 06:30:42 +00:00
.editorconfig Add editorconfig 2024-05-02 13:48:29 -05:00
.gitattributes Add gitattributes 2024-05-02 13:48:51 -05:00
.gitignore Add gitignore 2024-05-02 13:50:49 -05:00
action.yml feat(deps): update mcmahan/omnictl docker tag to v1.9.3 2026-07-16 21:06:22 +00:00
LICENSE Initial commit 2024-05-01 13:37:31 -05:00
README.md clean up working-directory input from examples 2026-06-09 15:49:43 -05:00

omnictl GitHub Action

This repository enables running general omnictl commands as GitHub Actions. Use this action to manage Sidero Omni resources as part of a GitOps workflow or CI/CD pipeline.

Configuration

Setup

Before using this action, you must create an Omni service account to authenticate with Sidero Omni. See https://omni.siderolabs.com/docs/how-to-guides/how-to-create-a-service-account/ for more information about creating a service account.

Once the service account is created, it is recommended to save the endpoint and service account key as repository secrets (Settings > Secrets and variables > Actions). The below examples assume these values are saved as OMNI_ENDPOINT and OMNI_SERVICE_ACCOUNT_KEY, respectively.

Inputs

Required inputs

Name Description
omni-endpoint The Omni endpoint URL generated for your service account. See https://omni.siderolabs.com/docs/how-to-guides/how-to-create-a-service-account/ for more information about creating a service account.
omni-service-account-key The Omni service account key generated for your service account. See https://omni.siderolabs.com/docs/how-to-guides/how-to-create-a-service-account/ for more information about creating a service account.
command The omnictl command to run. See https://omni.siderolabs.com/docs/reference/cli/ for a full list of omnictl commands and parameters.

Defaults to omnictl --version.

Optional inputs

Name Description
working-directory (Deprecated) The working directory from which to execute the command.

This input was a workaround for inconsistent relative path resolution based on omnictl's working directory. Starting with omnictl version 1.8.0 (version 1.87.0 of this action), the cluster template command now consistently resolves all paths relative to the template file.

The preferred approach is to simply include the path in the -f parameter, e.g. command: omnictl cluster template -f ./path/to/cluster.yaml sync.

Examples

Validate a cluster template

on:
  push:
    branches:
      - main
    paths:
      - 'path/to/cluster/resources/**'

jobs:
  validate:
    runs-on: ubuntu-latest
    name: Validate cluster templates
    steps:
      - name: Checkout cluster templates
        uses: actions/checkout@v4

      - name: Run omnictl
        uses: jdmcmahan/omnictl-action@v1
        with:
          omni-endpoint: ${{ secrets.OMNI_ENDPOINT }}
          omni-service-account-key: ${{ secrets.OMNI_SERVICE_ACCOUNT_KEY }}
          command: omnictl cluster template -f ./path/to/cluster/resources/cluster.yaml validate

Sync a cluster template with Omni

on:
  push:
    branches:
      - main
    paths:
      - 'path/to/cluster/resources/**'

jobs:
  sync:
    runs-on: ubuntu-latest
    name: Sync cluster templates with Sidero Omni
    steps:
      - name: Checkout cluster templates
        uses: actions/checkout@v4

      - name: Run omnictl
        uses: jdmcmahan/omnictl-action@v1
        with:
          omni-endpoint: ${{ secrets.OMNI_ENDPOINT }}
          omni-service-account-key: ${{ secrets.OMNI_SERVICE_ACCOUNT_KEY }}
          command: omnictl cluster template -f ./path/to/cluster/resources/cluster.yaml sync --verbose

Create or update a resource directly

on:
  push:
    branches:
      - main
    paths:
      - 'path/to/cluster/resources/**'

jobs:
  apply:
    runs-on: ubuntu-latest
    name: Create or update a super important Omni resource
    steps:
      - name: Checkout cluster templates
        uses: actions/checkout@v4

      - name: Run omnictl
        uses: jdmcmahan/omnictl-action@v1
        with:
          omni-endpoint: ${{ secrets.OMNI_ENDPOINT }}
          omni-service-account-key: ${{ secrets.OMNI_SERVICE_ACCOUNT_KEY }}
          command: omnictl apply -f ./path/to/cluster/resources/resource.yaml --verbose