From 4739e2bb506e2737f04a2df9e008d2dd6f9da057 Mon Sep 17 00:00:00 2001 From: developowl Date: Wed, 25 Nov 2026 14:54:27 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20gitops=20=EB=A0=88=ED=8F=AC=20PR=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D=20=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR마다 kubeconform으로 매니페스트를 Kubernetes 스키마(ArgoCD CRD 포함)에 맞춰 검증하고, 차트가 있으면 helm lint를 실행한다. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Ws9Xo8JS1c9scfrMUcVYrD --- .github/workflows/validate.yml | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..1f385fe --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,55 @@ +name: validate + +on: + pull_request: + paths: + - "apps/**" + - "bootstrap/**" + - "platform/**" + - "tenants/**" + - ".github/workflows/validate.yml" + +permissions: + contents: read + +env: + KUBECONFORM_VERSION: v0.7.0 + KUBERNETES_VERSION: 1.33.0 + +jobs: + kubeconform: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install kubeconform + run: | + curl -fsSL "https://github.com/yannh/kubeconform/releases/download/${KUBECONFORM_VERSION}/kubeconform-linux-amd64.tar.gz" \ + | sudo tar xz -C /usr/local/bin kubeconform + kubeconform -v + + - name: Validate manifests + run: | + find apps bootstrap platform tenants -name '*.yaml' \ + -not -path 'bootstrap/argocd/*' -not -name 'values*.yaml' -print0 2>/dev/null \ + | xargs -0 kubeconform -strict -summary -output pretty \ + -kubernetes-version "${KUBERNETES_VERSION}" \ + -schema-location default \ + -schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' + + helm-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: azure/setup-helm@v4 + + - name: Lint charts + run: | + charts=$(find . -name Chart.yaml -not -path './.git/*' -exec dirname {} \;) + if [ -z "$charts" ]; then + echo "::notice::차트가 없어 건너뜀" + exit 0 + fi + for chart in $charts; do + helm lint "$chart" + done