Skip to content

Helm Diff Preview

Description

This GitHub Action generates a diff of Helm chart templates between the current branch and the base branch of a pull request. It uses the helm template command to render the templates and compares them using diff. The action is designed to be used in a GitHub Actions workflow, particularly for pull requests.

Inputs

name description type required default
helm_chart_path

Path to the Helm chart directory

string false deploy/app
environments_path

Path to the directory containing environment-specific values

string false deploy/app/envs
output_path

Path to the output directory for diffs

string false output
base_branch

Base branch for comparison

string false ${{ github.event.pull_request.base.ref }}
helm_release_name

Name to use for the Helm release when templating

string false app
helm_repo_url

URL of the Helm repository to add

string false https://dnd-it.github.io/helm-charts
helm_repo_name

Name to give to the Helm repository

string false dnd-it
debug

Enable debug output

string false false

Usage

jobs:
  job1:
    uses: dnd-it/github-workflows/.github/workflows/gitops-helm-diff.yaml@v2
    with:
      helm_chart_path:
      # Path to the Helm chart directory
      #
      # Type: string
      # Required: false
      # Default: deploy/app

      environments_path:
      # Path to the directory containing environment-specific values
      #
      # Type: string
      # Required: false
      # Default: deploy/app/envs

      output_path:
      # Path to the output directory for diffs
      #
      # Type: string
      # Required: false
      # Default: output

      base_branch:
      # Base branch for comparison
      #
      # Type: string
      # Required: false
      # Default: ${{ github.event.pull_request.base.ref }}

      helm_release_name:
      # Name to use for the Helm release when templating
      #
      # Type: string
      # Required: false
      # Default: app

      helm_repo_url:
      # URL of the Helm repository to add
      #
      # Type: string
      # Required: false
      # Default: https://dnd-it.github.io/helm-charts

      helm_repo_name:
      # Name to give to the Helm repository
      #
      # Type: string
      # Required: false
      # Default: dnd-it

      debug:
      # Enable debug output
      #
      # Type: string
      # Required: false
      # Default: false

Example

```yaml name: Helm Diff Example

on: pull_request: branches: - main paths: - deploy/app/**

jobs: helm-diff: uses: dnd-it/github-workflows/.github/workflows/.github/workflows/gitops-helm-diff.yaml@v2 with: debug: true

FAQ