Skip to content

Commit 48456e6

Browse files
authored
Add kubeconform scan (#18)
* add kubeconform scan * fix kubeconform action * re-add commented actions to pr-push
1 parent e768e0e commit 48456e6

File tree

5 files changed

+634
-1
lines changed

5 files changed

+634
-1
lines changed

.github/workflows/kubeconform.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on:
2+
workflow_call:
3+
4+
jobs:
5+
kubeconform:
6+
name: Kubeconform
7+
permissions:
8+
contents: read
9+
runs-on: ubuntu-22.04
10+
steps:
11+
# Deliberately set up Kubeconform before checking out the repository, as we might otherwise get name collisions
12+
# between the kubeconform directory and kubeconform binary (which have the same name).
13+
- name: Setup Kubeconform
14+
run: |
15+
curl -L -O https://github.com/yannh/kubeconform/releases/download/v0.6.7/kubeconform-linux-amd64.tar.gz
16+
tar -xvf kubeconform-linux-amd64.tar.gz
17+
mv kubeconform /usr/local/bin
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- name: Run Kubeconform
21+
run: make kubeconform

.github/workflows/main-push.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ jobs:
1414
end-to-end:
1515
name: End-to-end
1616
uses: ./.github/workflows/test-end-to-end.yml
17+
kubeconform:
18+
name: Kubeconform
19+
uses: ./.github/workflows/kubeconform.yml
1720
build:
1821
name: Build
1922
uses: ./.github/workflows/build.yml
2023
secrets: inherit
21-
needs: [test, lint, end-to-end]
24+
needs: [test, lint, end-to-end, kubeconform]
2225
with:
2326
version: '${{ github.sha }}'
2427
push: true

.github/workflows/pr-push.yml

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ jobs:
1313
end-to-end:
1414
name: End-to-end
1515
uses: ./.github/workflows/test-end-to-end.yml
16+
kubeconform:
17+
name: Kubeconform
18+
uses: ./.github/workflows/kubeconform.yml

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,11 @@ image:
4949
.PHONY: run-image
5050
run-image:
5151
docker run --volume "./settings:/settings" $(IMAGE_TAG) --config-file="/settings/tainter.toml"
52+
53+
.PHONY: kubeconform
54+
kubeconform:
55+
kubeconform \
56+
-schema-location default \
57+
-schema-location 'kubeconform/schemas/{{ .ResourceKind }}.json' \
58+
-strict \
59+
-summary deploy

0 commit comments

Comments
 (0)