-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
90 lines (81 loc) · 2.97 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: 'kube-check-action'
description: 'Execute kustomize build and use kubeconform and kube-linter for checking'
inputs:
kustomize_version:
description: kustomize version
required: false
default: "5.4.0"
kubeconform_version:
description: kubeconform version
required: false
default: "0.6.4"
kube-linter_version:
description: kube-linter version
required: false
default: "0.6.8"
pluto_version:
description: pluto version
required: false
default: "5.19.0"
kustomize_build_input:
description: 'Input parameter for kustomize build'
required: true
kubeconform_flags:
description: flags to supply to kubeconform
required: false
kube-linter_flags:
description: flags to supply to kube-linter lint
required: false
runs:
using: "composite"
steps:
- name: Install kustomize
uses: giantswarm/[email protected]
with:
binary: "kustomize"
version: ${{ inputs.kustomize_version }}
download_url: "https://github.com/kubernetes-sigs/${binary}/releases/download/${binary}%2Fv${version}/${binary}_v${version}_linux_amd64.tar.gz"
tarball_binary_path: "${binary}"
smoke_test: "${binary} version"
- name: Install kubeconform
uses: giantswarm/[email protected]
with:
binary: "kubeconform"
version: ${{ inputs.kubeconform_version }}
download_url: "https://github.com/yannh/kubeconform/releases/download/v${version}/kubeconform-linux-amd64.tar.gz"
tarball_binary_path: "${binary}"
smoke_test: "${binary} -v"
- name: Install kube-linter
uses: giantswarm/[email protected]
with:
binary: "kube-linter"
version: ${{ inputs.kube-linter_version }}
download_url: "https://github.com/stackrox/kube-linter/releases/download/v${version}/kube-linter-linux.tar.gz"
tarball_binary_path: "${binary}"
smoke_test: "${binary} version"
- name: Install pluto
uses: giantswarm/[email protected]
with:
binary: "pluto"
version: ${{ inputs.pluto_version }}
download_url: "https://github.com/FairwindsOps/pluto/releases/download/v${version}/pluto_${version}_linux_amd64.tar.gz"
tarball_binary_path: "${binary}"
smoke_test: "${binary} version"
- name: Build manifests
shell: bash
run: |
target_dir="$(mktemp -d -q --suffix -kube-check-action)"
echo "target_dir=$target_dir" >> $GITHUB_ENV
kustomize build "${{ inputs.kustomize_build_input }}" --output "${target_dir}/manifest.yaml"
- name: Run kubeconform
shell: bash
run: |
kubeconform ${{ inputs.kubeconform_flags }} "${{ env.target_dir }}"
- name: Run kube-linter
shell: bash
run: |
kube-linter lint ${{ inputs.kube-linter_flags }} "${{ env.target_dir }}"
- name: Use pluto
shell: bash
run: |
pluto --no-footer detect-files -d "${{ env.target_dir }}"