Skip to content

Commit ef67477

Browse files
committed
generate sbom and upload+inline
1 parent 7abfc93 commit ef67477

File tree

1 file changed

+39
-7
lines changed

1 file changed

+39
-7
lines changed

.github/workflows/test_build_push.yml

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,25 +86,57 @@ jobs:
8686
restore-keys: |
8787
${{ runner.os }}-buildx-
8888
89+
- name: Generate SBOM
90+
uses: anchore/[email protected]
91+
with:
92+
image: gilcreator/html2rss-web:latest
93+
output-file: sbom.spdx.json
94+
95+
- name: Upload SBOM Artifact
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: sbom
99+
path: sbom.spdx.json
100+
101+
# - name: Publish SBOM to Docker Hub Description
102+
# env:
103+
# DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
104+
# DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
105+
# run: |
106+
# curl -s -X PATCH "https://hub.docker.com/v2/repositories/${IMAGE_NAME}/" \
107+
# -H "Content-Type: application/json" \
108+
# -u "$DOCKERHUB_USERNAME:$DOCKERHUB_TOKEN" \
109+
# -d '{"full_description": "Auto-generated SBOM: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts"}'
110+
89111
- name: Build and push Docker image
90112
uses: docker/build-push-action@v5
91113
with:
92114
context: .
93115
push: false
94-
# tags: |
95-
# gilcreator/html2rss-web:latest
96-
# ghcr.io/${{ github.repository_owner }}/html2rss-web:latest
116+
tags: |
117+
gilcreator/html2rss-web:latest
118+
ghcr.io/${{ github.repository_owner }}/html2rss-web:latest
97119
platforms: linux/amd64,linux/arm64
98120
cache-from: type=local,src=/tmp/.buildx-cache
99121
cache-to: type=local,dest=/tmp/.buildx-cache-new
100-
101-
- name: Scan Docker image for vulnerabilities
102-
uses: aquasecurity/[email protected]
122+
provenance: true
123+
labels: |
124+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
125+
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
126+
org.opencontainers.image.revision=${{ github.sha }}
127+
org.opencontainers.image.title=html2rss-web
128+
org.opencontainers.image.description=Generates RSS feeds of any website & serves to the web!
129+
org.opencontainers.image.sbom=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts
130+
131+
- name: Scan Docker image for vulnerabilities (Trivy)
132+
uses: aquasecurity/[email protected]
103133
with:
104134
image-ref: gilcreator/html2rss-web:latest
105135
format: table
106-
exit-code: 0
136+
exit-code: 1
107137
ignore-unfixed: true
138+
vuln-type: os,library
139+
severity: CRITICAL,HIGH
108140

109141
- name: Move updated cache into place
110142
run: |

0 commit comments

Comments
 (0)