aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/lint-kubernetes.yaml
blob: 9c373eb7af880f091199dea2493c87bc808eb718 (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/[email protected]

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

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