Skip to content

Commit c6d6257

Browse files
haasonsaasclaude
andcommitted
Add cargo audit CI job and SBOM generation to release workflow
- New security job in CI runs cargo audit on every push/PR - Release workflow generates SPDX SBOM via anchore/sbom-action and uploads it as a release asset Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bb344ab commit c6d6257

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ jobs:
2828
- name: Clippy
2929
run: cargo clippy -- -D warnings
3030

31+
security:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: dtolnay/rust-toolchain@stable
36+
- uses: Swatinem/rust-cache@v2
37+
- name: Install cargo-audit
38+
run: cargo install cargo-audit --locked
39+
- name: Audit dependencies
40+
run: cargo audit
41+
3142
test:
3243
runs-on: ${{ matrix.os }}
3344
strategy:

.github/workflows/release.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,16 @@ jobs:
248248
- name: Sign image (keyless)
249249
env:
250250
IMAGE_REF: ghcr.io/haasonsaas/diffscope@${{ steps.build-and-push.outputs.digest }}
251-
run: cosign sign --yes "${IMAGE_REF}"
251+
run: cosign sign --yes "${IMAGE_REF}"
252+
253+
- name: Generate SBOM
254+
uses: anchore/sbom-action@v0
255+
with:
256+
image: ghcr.io/haasonsaas/diffscope@${{ steps.build-and-push.outputs.digest }}
257+
format: spdx-json
258+
output-file: sbom-diffscope.spdx.json
259+
260+
- name: Upload SBOM to release
261+
env:
262+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
263+
run: gh release upload ${{ github.ref_name }} sbom-diffscope.spdx.json --clobber || true

0 commit comments

Comments
 (0)