Skip to content

Commit e6be24e

Browse files
authored
Add annotations for Artifact Hub (#1554)
Problem: The image is not scanning correctly on Artifact Hub because of the missing annotations in the OCI manifest. Solution: Add the required annotations and some optional ones to improve the listing. This also uploads the SBOMs to GitHub in addition to the Sarif.
1 parent 4a924fc commit e6be24e

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ jobs:
100100
labels: |
101101
org.opencontainers.image.documentation=https://docs.nginx.com/nginx-gateway-fabric
102102
org.opencontainers.image.vendor=NGINX Inc <[email protected]>
103+
annotations: |
104+
org.opencontainers.image.documentation=https://docs.nginx.com/nginx-gateway-fabric
105+
org.opencontainers.image.vendor=NGINX Inc <[email protected]>
106+
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/nginxinc/nginx-gateway-fabric/main/README.md
107+
io.artifacthub.package.logo-url=https://docs.nginx.com/nginx-gateway-fabric/images/icons/NGINX-product-icon.svg
108+
io.artifacthub.package.maintainers=[{"name":"NGINX Inc","email":"[email protected]"}]
109+
io.artifacthub.package.license=Apache-2.0
110+
io.artifacthub.package.keywords=kubernetes,gateway,nginx
103111
env:
104112
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
105113

@@ -119,7 +127,7 @@ jobs:
119127
pull: true
120128
no-cache: ${{ github.event_name != 'pull_request' }}
121129
sbom: true
122-
provenance: true
130+
provenance: mode=max
123131
build-args: |
124132
NJS_DIR=internal/mode/static/nginx/modules/src
125133
NGINX_CONF_DIR=internal/mode/static/nginx/conf
@@ -128,9 +136,10 @@ jobs:
128136
${{ contains(inputs.image, 'plus') && format('"nginx-repo.crt={0}"', secrets.NGINX_CRT) || '' }}
129137
${{ contains(inputs.image, 'plus') && format('"nginx-repo.key={0}"', secrets.NGINX_KEY) || '' }}
130138
131-
- name: Inspect SBOM
139+
- name: Inspect SBOM and output manifest
132140
run: |
133141
docker buildx imagetools inspect localhost:5000/nginx-gateway-fabric/${{ inputs.image }}:${{ steps.meta.outputs.version }} --format '{{ json (index .SBOM "linux/amd64").SPDX }}' > sbom-${{ inputs.image }}.json
142+
docker buildx imagetools inspect localhost:5000/nginx-gateway-fabric/${{ inputs.image }}:${{ steps.meta.outputs.version }} --raw
134143
135144
- name: Scan SBOM
136145
id: scan
@@ -150,6 +159,8 @@ jobs:
150159
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
151160
continue-on-error: true
152161
with:
153-
name: scan-results-${{ inputs.image }}.sarif
154-
path: ${{ steps.scan.outputs.sarif }}
162+
name: scan-results-${{ inputs.image }}
163+
path: |
164+
${{ steps.scan.outputs.sarif }}
165+
!sbom-nginx-plus.json
155166
if: always()

0 commit comments

Comments
 (0)