File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Docker build and container scan
2+
3+ on :
4+ push :
5+ branches :
6+ - ' **'
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout
13+ uses : actions/checkout@v2
14+
15+ - name : Docker build
16+ run : |
17+ docker build . --file Dockerfile --tag containerscanner:${{ github.sha }}
18+
19+ - name : Anchore scan
20+ uses : anchore/scan-action@1.0.6
21+ with :
22+ image-reference : containerscanner:${{ github.sha }}
23+ dockerfile-path : Dockerfile
24+ include-app-packages : true
25+ fail-build : true # no idea why it doesn't work
26+
27+ - name : Show Anchore results
28+ run : for j in `ls ./anchore-reports/*.json`; do echo "---- ${j} ----"; cat ${j}; echo; done
29+ if : ${{ always() }}
30+
31+ - name : Upload Anchore results
32+ uses : actions/upload-artifact@v2
33+ with :
34+ name : anchore-reports
35+ path : ./anchore-reports/
36+ if : ${{ always() }}
37+
38+ - name : Fail on any vulnerability
39+ run : jq -e '.vulnerabilities | any( . ) | not' anchore-reports/vulnerabilities.json
You can’t perform that action at this time.
0 commit comments