From 2a5868a72fb2408e605a6e416f3355dddc8dbfa2 Mon Sep 17 00:00:00 2001 From: Tom van Dinther <39470469+tvandinther@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:46:22 +0100 Subject: [PATCH] update action name, arg and include further test (#16) --- .github/workflows/test.yaml | 6 +++++- action.yaml | 3 ++- example/main.k | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 426fd41..8acf6d2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,6 +13,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - uses: ./ + - name: Use Action - Render + uses: ./ with: filepath: example/main.k + + - name: Check output + run: cat rendered/example.yaml diff --git a/action.yaml b/action.yaml index be9a38b..87cc6cf 100644 --- a/action.yaml +++ b/action.yaml @@ -1,4 +1,4 @@ -name: knit +name: knit-render description: A tool for managing kubernetes manifests with KCL inputs: filepath: @@ -8,4 +8,5 @@ runs: using: "docker" image: "docker://ghcr.io/tvandinther/knit:v0.0.3" args: + - render - ${{ inputs.filepath }} diff --git a/example/main.k b/example/main.k index a3525e3..cd9559c 100644 --- a/example/main.k +++ b/example/main.k @@ -2,6 +2,8 @@ import vendored.helm.podinfo import knit.helm import knit.kustomize import manifests +import file +import yaml _chart = podinfo.Chart { releaseName = "my-app" @@ -30,3 +32,5 @@ _argocd = kustomize.build(kustomize.Kustomization { # Outputs all kustomized podinfo and Argo CD resource manifests manifests.yaml_stream(_kustomizedPodinfo + _argocd) +file.mkdir("rendered") +yaml.dump_all_to_file(_argocd, "rendered/example.yaml")