-
-
Notifications
You must be signed in to change notification settings - Fork 20
54 lines (47 loc) · 1.81 KB
/
Copy pathdatree-validation.yml
File metadata and controls
54 lines (47 loc) · 1.81 KB
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
name: Datree Workflow
on:
push:
paths:
- '**/*.yaml'
- '**/*.yml'
pull_request:
types: [opened, edited, synchronize, reopened]
paths:
- '**/*.yaml'
- '**/*.yml'
jobs:
configs-validation:
runs-on: ubuntu-latest
env:
DATREE_TOKEN: ${{ secrets.DATREE_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files: |
*.yaml
*.yml
- name: List all changed files
run: echo ${{ steps.changed-files.outputs.all_changed_files }}
- name: Install Datree's CLI
if: steps.changed-files.outputs.any_changed == 'true'
run: curl https://get.datree.io | /bin/bash -s
# |=========================== Datree Policy Check ===================================|
# | Prevent Kubernetes misconfigurations from reaching production! |
# | Datree is a CLI tool to ensure K8s configs follow stability & security |
# | best practices as well as your organization’s policies. |
# | For more info visit: https://github.com/datreeio/datree |
# |===================================================================================|
- name: Datree validate config files
if: steps.changed-files.outputs.any_changed == 'true'
uses: datreeio/action-datree@main # For more info about this Actions visit 👉 https://github.com/datreeio/action-datree
with:
path: ${{ steps.changed-files.outputs.all_changed_files }}
cliArguments: --only-k8s-files
isHelmChart: false
isKustomization: false