-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yaml
49 lines (49 loc) · 1.5 KB
/
action.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
name: "Mondoo Policy Action"
description: "A GitHub Action to add Mondoo policies on Mondoo Platform."
branding:
icon: "shield"
color: "purple"
inputs:
args:
description: >-
Additional arguments to pass to Mondoo Client.
required: false
log-level:
description: >-
Sets the log level: error, warn, info, debug, trace (default "info")
default: info
required: false
output:
description: >-
Set the output format for scan results: compact, yaml, json, junit, csv, summary, full, report (default "compact")
default: compact
required: false
path:
description: Path to the policy file.
required: true
service-account-credentials:
description: "Base64 encoded service account credentials used to authenticate with Mondoo Platform"
required: true
runs:
using: "composite"
steps:
- name: Install Mondoo Client
shell: bash
run: |
echo Installing Mondoo Client...
echo ${{ inputs.service-account-credentials }} | base64 -d > mondoo.json
curl -sSL https://mondoo.com/install.sh | bash
- name: Mondoo status
shell: bash
run: mondoo status --config mondoo.json
- name: Validate Mondoo Policy
shell: bash
run: mondoo policy validate ${{ inputs.path }}
- name: Run mondoo policy add
shell: bash
run: >
mondoo policy add ${{ inputs.path }}
--log-level ${{ inputs.log-level }}
--output ${{ inputs.output }}
${{ inputs.args }}
--config mondoo.json