Last active
September 19, 2023 21:18
-
-
Save dillonstreator/59f27eee5e27a2fb3c34f9f5bb7f41f4 to your computer and use it in GitHub Desktop.
Github Action to validate Kubernetes yaml in a directory (`k8s`) with `kubeconform` including popular CRD's
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate Kubernetes YAML | |
on: [pull_request] | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install kubeconform v0.6.3 | |
run: | | |
curl -s -L https://github.com/yannh/kubeconform/releases/download/v0.6.3/kubeconform-linux-amd64.tar.gz | tar xvz | |
sudo mv kubeconform /usr/local/bin/kubeconform | |
- name: Validate K8s YAML files | |
run: | | |
/usr/local/bin/kubeconform \ | |
--strict \ | |
--schema-location=https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master \ | |
--schema-location=https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/\{\{.Group\}\}/\{\{.ResourceKind\}\}_\{\{.ResourceAPIVersion\}\}.json \ | |
k8s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment