Skip to content

WDaan/helm-kubeconform-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helm Kubeconform Action

A flexible GitHub Action to validate Helm charts with Kubeconform.

Usage

Assuming you have a charts directory under which you have a set of charts and a schemas directory containing any custom resource schemas, like this:

charts
└───foo
│  ├───templates
│  └───tests
└───bar
│  ├───templates
│  └───tests
└───schemas

Example usage in workflow

name: Chart Test
on: [push] 
jobs:
    kubeconform:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Validate Helm Chart
      uses: wdaan/helm-kubeconform-action@v0.1.6
      with:
        additionalSchemaPaths: |
          schemas/{{ .ResourceKind }}.json
        chartsDirectory: "charts"
        ignoreMissingSchemas: "true"
        kubernetesVersion: "1.25.0"

Example usage with docker (faster)

    - name: Login to GitHub Container Registry
      uses: docker/login-action@v2
      with:
        registry: ghcr.io
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}

    - name: Validate Helm Chart
      uses: docker://ghcr.io/wdaan/helm-kubeconform-action:v0.1.7
      env:
        ADDITIONAL_SCHEMA_PATHS: |
          schemas/{{ .ResourceKind }}.json
        CHARTS_DIRECTORY: "charts"
        KUBECONFORM_STRICT: "true"
        HELM_UPDATE_DEPENDENCIES: "true"
        IGNORE_MISSING_SCHEMAS: "false"
        KUBERNETES_VERSION: "1.25.0"

See action.yml for more information on the parameters.

Schemas

The default Kubernetes schema will always be automatically included. If you need to add custom schemas, additionalSchemaPaths should be a list of paths, one per line, in the format expected by Kubeconform. These are relative to the root of your repository.

Tests

Every chart subdirectory must have a tests subdirectory containing values files as you would pass to Helm. Each file will be passed on its own to helm template release charts/MY_CHART and the results will be validated by Kubeconform.

About

GitHub Action to validate Helm charts with Kubeconform

Resources

License

Stars

Watchers

Forks

Languages

  • Go 83.0%
  • Dockerfile 13.0%
  • Makefile 4.0%