-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
76 lines (74 loc) · 3.35 KB
/
action.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 Authors of KubeArmor
name: 'kubearmor-action'
description: 'kubearmor-action'
inputs:
old-summary-path: # old summary report path
description: 'Old summary report path'
required: false
default: ''
namespace: # namespace of the app
description: 'Namespace of the app'
required: false
app-name: # app name to filter, if not set, will show all apps
description: 'App name to filter, if not set, will show all apps'
required: false
default: ''
file: # the summary report file name
description: 'The summary report file name'
required: false
default: 'summary.json'
install-kubearmor: # whether to install kubearmor
description: 'Whether to install kubearmor'
required: false
default: 'false'
save-summary-report: # whether to save the summary report
description: 'Whether to save the summary report'
required: false
default: 'false'
visualise: # whether to generate visualisation report
description: 'Whether to generate visualisation report'
required: false
default: 'false'
outputs:
summary-report-artifact:
description: The name of the artifact containing the summary report
value: ${{ steps.save-summary-report.outputs.summary-report-artifact }}
summary-report-file:
description: The name of the actual file in the artifact, which contains the summary report
value: ${{ steps.save-summary-report.outputs.summary-report-file }}
visualisation-results-artifact:
description: The name of the artifact containing the visualisation report
value: ${{ steps.visualisation-report.outputs.visualisation-results-artifact }}
sys-visualisation-image:
description: The name of the actual file in the artifact, which contains the system visualisation report
value: ${{ steps.visualisation-report.outputs.sys-visualisation-image }}
network-visualisation-image:
description: The name of the actual file in the artifact, which contains the network visualisation report
value: ${{ steps.visualisation-report.outputs.network-visualisation-image }}
runs:
using: composite
steps:
# Install kubearmor
- name: Install kubearmor
if: inputs.install-kubearmor == 'true' # only run this step if install-kubearmor is true
id: install-kubearmor
uses: kubearmor/kubearmor-action/actions/install-kubearmor@main
# Save the new app summary report
- name: Save the new app summary report
if: inputs.save-summary-report == 'true' # only run this step if save-summary-report is true
uses: kubearmor/kubearmor-action/actions/save-summary-report@main
id: save-summary-report
with:
namespace: ${{ inputs.namespace }}
file: ${{ inputs.file }}
# Generate visualisation report
- name: Kubearmor-action visualisation
if: inputs.save-summary-report == 'true' && inputs.visualise == 'true' # only run this step if visualise is true and save-summary-report is true
id: visualisation-report
uses: kubearmor/kubearmor-action/actions/visual-report@main
with:
old-summary-path: ${{ inputs.old-summary-path }}
new-summary-path: '${{ github.workspace }}/${{ steps.save-summary-report.outputs.summary-report-file }}'
namespace: ${{ inputs.namespace }}
app-name: ${{ inputs.app-name }}