48 lines (37 loc) · 1.42 KB
/
microk8s-kube-bench.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
name: MicroK8s kube-bench
on:
push:
#schedule:
# - cron: '0 1 * * *'
workflow_dispatch:
inputs:
workflowAction:
description: 'Action'
default: 'Run MicroK8s + kube-bench'
required: true
jobs:
microk8s-kube-bench:
runs-on: ubuntu-20.04
steps:
- name: Check environment
run: |-
lsb_release -a
- name: Checkout
uses: actions/checkout@v3
- name: install MicroK8s + kube-bench
env:
G_MK8S_INSTALL: true
G_KUBE_BENCH_DEPLOY: true
run: |-
sudo -- bash -c "export MK8S_INSTALL=$G_MK8S_INSTALL \
&& export KUBE_BENCH_DEPLOY=$G_KUBE_BENCH_DEPLOY \
&& sh/microk8s-kube-bench.sh"
- name: commit back changed files
run: |
git add -A
git config --local user.name "Github Action from $GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git diff --quiet && git diff --staged --quiet || git commit -m "changes committed back by actor $GITHUB_ACTOR on $HELMALYZER_TIMESTAMP (workflow: $GITHUB_WORKFLOW - job: $GITHUB_JOB - sha: $GITHUB_SHA - ref: $GITHUB_REF)"
git config pull.rebase false
git diff --quiet && git diff --staged --quiet || git pull
git push https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY