1616 timeout-minutes : 30
1717 steps :
1818 - name : Check out the repo
19- uses : actions/checkout@v2
19+ uses : actions/checkout@v3
2020 - name : Set imageName based on the repository name
2121 id : step_one
2222 run : |
@@ -25,44 +25,38 @@ jobs:
2525 echo "imageName=$imageName" >> $GITHUB_ENV
2626 - name : Docker meta
2727 id : docker_meta
28- uses : crazy-max/ghaction-docker-meta@v1
28+ uses : docker/metadata-action@v4
2929 with :
3030 images : ${{ env.imageName }}
3131 - name : Set up QEMU
32- uses : docker/setup-qemu-action@v1
32+ uses : docker/setup-qemu-action@v2
3333 - name : Set up Docker Buildx
34- uses : docker/setup-buildx-action@v1
35- - name : Login to Harbor
36- uses : docker/login-action@v1
34+ uses : docker/setup-buildx-action@v2
35+ - name : Login to DockerHub
36+ uses : docker/login-action@v2
3737 with :
3838 username : ${{ secrets.DOCKERHUB_USERNAME }}
3939 password : ${{ secrets.DOCKERHUB_TOKEN }}
40- - name : Buildx cache
41- uses : actions/cache@v1
42- with :
43- path : ${{ github.workspace }}/cache
44- key : ${{ runner.os }}-docker-${{ hashfiles('cache/**') }}
45- restore-keys : |
46- ${{ runner.os }}-docker
4740 - name : Build and push
4841 id : docker_build
49- uses : docker/build-push-action@v2
42+ uses : docker/build-push-action@v3
5043 with :
5144 platforms : ${{ env.platforms }}
5245 push : ${{ github.event_name != 'pull_request' }}
5346 tags : ${{ steps.docker_meta.outputs.tags }}
5447 labels : ${{ steps.docker_meta.outputs.labels }}
55- cache-from : type=local,src=${{ github.workspace }}/cache
56- cache-to : type=local,dest=${{ github.workspace }}/cache
57- # temporarily disabled until https://github.com/aquasecurity/trivy-action/issues/22 is resolved
58- # - name: Run Trivy vulnerability scanner
59- # uses: aquasecurity/trivy-action@master
60- # with:
61- # image-ref: ${{ env.imageName }}:${{ steps.docker_meta.outputs.version }}
62- # format: "template"
63- # template: "@/contrib/sarif.tpl"
64- # output: "trivy-results.sarif"
65- # - name: Upload Trivy scan results to GitHub Security tab
66- # uses: github/codeql-action/upload-sarif@v1
67- # with:
68- # sarif_file: "trivy-results.sarif"
48+ - name : Run Trivy vulnerability scanner
49+ uses : aquasecurity/trivy-action@master
50+ with :
51+ image-ref : ${{ env.imageName }}:${{ steps.docker_meta.outputs.version }}
52+ format : ' sarif'
53+ output : ' trivy-results.sarif'
54+ ignore-unfixed : true
55+ vuln-type : ' os,library'
56+ security-checks : ' vuln'
57+ severity : ' CRITICAL,HIGH'
58+ timeout : ' 10m0s'
59+ - name : Upload Trivy scan results to GitHub Security tab
60+ uses : github/codeql-action/upload-sarif@v2
61+ with :
62+ sarif_file : " trivy-results.sarif"
0 commit comments