Skip to content

Commit d2d176a

Browse files
authored
Add steps to submit images for certification (#142)
1 parent 1b62060 commit d2d176a

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
tags:
8-
- 'v[0-9]+.[0-9]+.[0-9]+'
8+
- "v[0-9]+.[0-9]+.[0-9]+"
99
pull_request:
1010
branches:
1111
- main
@@ -97,7 +97,7 @@ jobs:
9797
- name: Build Image
9898
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
9999
with:
100-
context: '.'
100+
context: "."
101101
cache-from: type=gha
102102
cache-to: type=gha,mode=max
103103
tags: ${{ steps.meta.outputs.tags }}
@@ -115,29 +115,29 @@ jobs:
115115
continue-on-error: true
116116
with:
117117
image-ref: nginx/nginx-ingress-operator:${{ steps.meta.outputs.version }}
118-
format: 'sarif'
119-
output: 'trivy-results.sarif'
120-
ignore-unfixed: 'true'
118+
format: "sarif"
119+
output: "trivy-results.sarif"
120+
ignore-unfixed: "true"
121121

122122
- name: Upload Trivy scan results to GitHub Security tab
123123
uses: github/codeql-action/upload-sarif@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
124124
continue-on-error: true
125125
with:
126-
sarif_file: 'trivy-results.sarif'
126+
sarif_file: "trivy-results.sarif"
127127

128128
- name: Upload Scan Results
129129
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
130130
continue-on-error: true
131131
with:
132-
name: 'trivy-results.sarif'
133-
path: 'trivy-results.sarif'
132+
name: "trivy-results.sarif"
133+
path: "trivy-results.sarif"
134134
if: always()
135135

136136
- name: Create/Update Draft
137137
uses: lucacome/draft-release@d13ccde6350706e32f451566ee5cd4bf5a27de3d # v0.2.1
138138
with:
139-
minor-label: 'enhancement'
140-
major-label: 'change'
139+
minor-label: "enhancement"
140+
major-label: "change"
141141
variables: |
142142
nic_version=${{ steps.vars.outputs.chart_version }}
143143
openshift_version=${{ steps.vars.outputs.openshift_version }}
@@ -147,3 +147,17 @@ jobs:
147147
- NGINX Ingress Controller {{nic_version}}
148148
- OpenShift {{openshift_version}} or newer.
149149
if: github.event_name != 'pull_request'
150+
151+
- name: Certify Images
152+
continue-on-error: true
153+
run: |
154+
curl -fsSL https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/1.6.9/preflight-linux-amd64 --output preflight
155+
chmod +x preflight
156+
157+
IFS=',' read -ra arch_list <<< "${{ env.platforms }}"
158+
159+
for arch in "${arch_list[@]}"; do
160+
architecture=("${arch#*/}")
161+
./preflight check container quay.io/nginx/nginx-ingress-operator:${{ steps.meta.outputs.version }} --pyxis-api-token ${{ secrets.PYXIS_API_TOKEN }} --certification-project-id ${{ secrets.CERTIFICATION_PROJECT_ID }} --platform $architecture --submit
162+
done
163+
if: ${{ startsWith(github.ref, 'refs/tags') }}

0 commit comments

Comments
 (0)