File tree 1 file changed +49
-0
lines changed
1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ name : Preflight Daily
3
+ ' on ' :
4
+ schedule :
5
+ - cron : ' 0 0 * * *'
6
+ # pull_request:
7
+ # branches: [ main ]
8
+ workflow_dispatch :
9
+
10
+ jobs :
11
+ preflight-debug-partner :
12
+ runs-on : ubuntu-22.04
13
+ env :
14
+ SHELL : /bin/bash
15
+ IMAGE_NAME : quay.io/testnetworkfunction/k8s-best-practices-debug:latest
16
+
17
+ steps :
18
+ - uses : actions/checkout@v4
19
+
20
+ - name : Set up Go 1.22
21
+ uses : actions/setup-go@v5
22
+ with :
23
+ go-version : 1.22.5
24
+
25
+ - name : Disable default go problem matcher
26
+ run : echo "::remove-matcher owner=go::"
27
+
28
+ - name : Clone the preflight repository
29
+ uses : actions/checkout@v4
30
+ with :
31
+ repository : redhat-openshift-ecosystem/openshift-preflight
32
+ path : openshift-preflight
33
+
34
+ - name : Run preflight
35
+ working-directory : openshift-preflight
36
+ run : |
37
+ make build
38
+ ./preflight check container ${{ env.IMAGE_NAME }} --artifacts ${GITHUB_WORKSPACE}/openshift-preflight/artifacts
39
+
40
+ ALLOWED_FAILURES=("HasLicense" "RunAsNonRoot")
41
+ FAILURES=$(cat ${GITHUB_WORKSPACE}/openshift-preflight/artifacts/amd64/results.json | jq -r '.results.failed[].name')
42
+
43
+ for FAILURE in $FAILURES; do
44
+ FAILURE=$(echo $FAILURE | tr -d '"')
45
+ if [[ ! " ${ALLOWED_FAILURES[@]} " =~ " ${FAILURE} " ]]; then
46
+ echo "ERROR: $FAILURE is not an allowed failure"
47
+ exit 1
48
+ fi
49
+ done
You can’t perform that action at this time.
0 commit comments