aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/lint-kubernetes.yaml
blob: fb5e00cf86b6fda1fb96fd3e287a2ea3dbd80d7b (plain) (blame)
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
name: Lint kubernetes manifests

on:
  workflow_call:
    secrets:
      kube-config:
        required: true

jobs:
  lint-manifests:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Get list of files
        run: |
          echo "manifests<<EOF" >> $GITHUB_OUTPUT
          python kubernetes/scripts/lint_manifests.py find >> $GITHUB_OUTPUT
          echo "EOF" >> $GITHUB_OUTPUT
        id: manifest-files

      - uses: azure/setup-kubectl@v3

      - name: Authenticate with Kubernetes
        uses: azure/k8s-set-context@v3
        with:
          method: kubeconfig
          kubeconfig: ${{ secrets.kube-config }}

      - uses: jb3/k8s-lint@master
        with:
          lintType: dryrun
          manifests: |
            ${{ steps.manifest-files.outputs.manifests }}