-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.37 KB
/
validate.yaml
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
############################
# @author Elias De Hondt #
# @see https://eliasdh.com #
# @since 24/11/2024 #
############################
name: Validate
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint-yaml:
name: Lint YAML Files
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
statuses: write
steps:
# Step 1
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# Step 2
- name: Lint YAML Files
uses: super-linter/super-linter@v7.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_YAML: true
VALIDATE_YAML_FILES: "supercluster/**/*"
validate-yaml:
name: Validate Kubernetes Manifests
runs-on: ubuntu-latest
needs: lint-yaml
steps:
# Step 1
- name: Checkout repository
uses: actions/checkout@v2
# Step 2
- name: Install kubectl
uses: azure/setup-kubectl@v3
with:
version: 'v1.28.0'
# Step 3
- name: Validate Kubernetes YAML
run: |
# Test all YAML files under 'Cluster01/' for syntax errors
for file in $(find cluster01 -name '*.yaml'); do
echo "Validating $file"
kubectl apply --dry-run=client -f $file
done