Skip to content
This repository was archived by the owner on Jun 9, 2026. It is now read-only.

blamas/yaml-linting-demo

Repository files navigation

YAML Linting Demo

This repo showcases a lightweight YAML workflow for Kubernetes/Helm content. It combines:

  • yamlfmt to normalize formatting
  • yamllint for structural/style validation in CI
  • lefthook to enforce yamlfmt in pre-commit

Repository layout

charts/demo/          # Sample Helm chart (templates intentionally skipped by linting)
manifests/            # YAML used to test formatter/linter
.github/workflows/    # Github Actions Definition

Quickstart

mise install
lefthook install

Github Actions

YAML Validation (see .github/workflows/yaml-lint.yaml) runs on pull requests touching YAML or lint configs. Steps:

  1. Detect changed YAML/config files.
  2. Install Python + yamllint via pip
  3. Run yamllint either on the full repo (when configs change) or only on changed files.

The workflow intentionally mirrors local expectations so developers see the same failures locally and in CI.

Troubleshooting

  • If yamlfmt complains about Helm templates, ensure your hooks exclude charts/*/templates/**.
  • Set LEFTHOOK=0 temporarily if you need to bypass hooks for emergency commits, but restore it afterwards to keep the workflow enforceable.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages