From 8f23933eca6e4d4915a4306e673650f7dad933cc Mon Sep 17 00:00:00 2001
From: bakhtin
Date: Mon, 28 Aug 2023 10:15:23 +0100
Subject: [PATCH] Add manifests validation step to PR workflow
Signed-off-by: bakhtin
---
.github/workflows/pr.yaml | 21 +++++++++++++++++++++
.pre-commit-hooks.yaml | 2 +-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml
index b071e1d1..cd242269 100644
--- a/.github/workflows/pr.yaml
+++ b/.github/workflows/pr.yaml
@@ -90,3 +90,24 @@ jobs:
--target-branch ${{ github.event.repository.default_branch }} \
--charts ${{ steps.list-changed.outputs.changed }}
if: steps.list-changed.outputs.changed
+
+ validate-manifests:
+ runs-on: ubuntu-latest
+ container: docker.io/paritytech/kube-manifests-validation:k8s-1.25.9-gator-3.12.0-datree-1.9.19-9196b4c
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - run: |
+ git config --system --add safe.directory $GITHUB_WORKSPACE
+ git fetch origin "+${GITHUB_BASE_REF}:${GITHUB_BASE_REF}"
+
+ - name: Validate manifests
+ run: |
+ /app/validate-k8s-manifests.sh \
+ --datree-policy-config /app/datree-policies.yaml \
+ --git-ref-changed-paths $GITHUB_BASE_REF \
+ --skip-gatekeeper \
+ charts
diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml
index 9b77c52c..f74dec69 100644
--- a/.pre-commit-hooks.yaml
+++ b/.pre-commit-hooks.yaml
@@ -1,7 +1,7 @@
- id: helm-docs
args: []
description: Uses 'helm-docs' to create documentation from the Helm chart's 'values.yaml' file, and inserts the result into a corresponding 'README.md' file.
- entry: git-hook/helm-docs
+ entry: git-hooks/helm-docs
files: (README\.md\.gotmpl|(Chart|requirements|values)\.yaml)$
language: script
name: Helm Docs