90
90
91
91
- name : Dockle Container Scanner
92
92
uses : erzz/dockle-action@v1
93
- if : ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref , 'refs/heads/develop ') }}
93
+ if : ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref , 'release ') }}
94
94
with :
95
95
image : ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
96
96
report-format : sarif
@@ -100,28 +100,28 @@ jobs:
100
100
# Disable upload due to bug https://github.com/erzz/dockle-action/issues/18
101
101
# - name: Upload Dockle SARIF Report
102
102
# uses: github/codeql-action/upload-sarif@v2
103
- # if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref , 'refs/heads/develop ') }}
103
+ # if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref , 'release ') }}
104
104
# with:
105
105
# sarif_file: dockle-report.sarif
106
106
107
107
- name : Trivy Vulnerability Scanner
108
108
uses : aquasecurity/trivy-action@master
109
- if : ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref , 'refs/heads/develop ') }}
109
+ if : ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref , 'release ') }}
110
110
with :
111
111
image-ref : ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
112
112
format : ' sarif'
113
113
output : ' trivy-results.sarif'
114
114
115
115
- name : Upload Trivy SARIF Report
116
116
uses : github/codeql-action/upload-sarif@v2
117
- if : ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref , 'refs/heads/develop ') }}
117
+ if : ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref , 'release ') }}
118
118
with :
119
119
sarif_file : ' trivy-results.sarif'
120
120
121
121
- name : Anchore Container Scan
122
122
id : anchore-scan
123
123
uses : anchore/scan-action@v3.3.0
124
- if : ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref , 'refs/heads/develop ') }}
124
+ if : ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref , 'release ') }}
125
125
with :
126
126
image : ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
127
127
fail-build : true
@@ -130,7 +130,7 @@ jobs:
130
130
131
131
- name : Upload Anchore Scan SARIF Report
132
132
uses : github/codeql-action/upload-sarif@v2
133
- if : ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref , 'refs/heads/develop ') }}
133
+ if : ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref , 'release ') }}
134
134
with :
135
135
sarif_file : ${{ steps.anchore-scan.outputs.sarif }}
136
136
token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments