Skip to content

Commit 1d0889e

Browse files
committed
Fix SBOM: use SPDX 2.3 format (CycloneDX failed schema validation)
1 parent b6c32a4 commit 1d0889e

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -424,33 +424,39 @@ jobs:
424424
with:
425425
subject-path: 'checksums.txt'
426426

427-
# ── SBOM generation ──────────────────────────────────────
427+
# ── SBOM generation (SPDX format) ──────────────────────────
428428
- name: Generate SBOM
429429
run: |
430430
python3 -c "
431-
import json
431+
import json, uuid
432432
sbom = {
433-
'bomFormat': 'CycloneDX',
434-
'specVersion': '1.4',
435-
'version': 1,
436-
'metadata': {'component': {'type': 'application', 'name': 'codebase-memory-mcp', 'version': '${{ inputs.version }}'}},
437-
'components': [
438-
{'type': 'library', 'name': 'sqlite3', 'version': '3.49.1', 'description': 'Vendored SQLite amalgamation'},
439-
{'type': 'library', 'name': 'yyjson', 'version': '0.10.0', 'description': 'Fast JSON parser'},
440-
{'type': 'library', 'name': 'mongoose', 'version': '7.16', 'description': 'Embedded HTTP server'},
441-
{'type': 'library', 'name': 'mimalloc', 'version': '2.1.7', 'description': 'Memory allocator'},
442-
{'type': 'library', 'name': 'xxhash', 'version': '0.8.2', 'description': 'Fast hash function'},
443-
{'type': 'library', 'name': 'tre', 'version': '0.8.0', 'description': 'POSIX regex (Windows)'},
444-
{'type': 'library', 'name': 'tree-sitter', 'version': '0.24.4', 'description': 'AST parser runtime (64 grammars)'}
433+
'spdxVersion': 'SPDX-2.3',
434+
'dataLicense': 'CC0-1.0',
435+
'SPDXID': 'SPDXRef-DOCUMENT',
436+
'name': 'codebase-memory-mcp-${{ inputs.version }}',
437+
'documentNamespace': 'https://github.com/DeusData/codebase-memory-mcp/releases/${{ inputs.version }}',
438+
'creationInfo': {
439+
'created': '$(date -u +%Y-%m-%dT%H:%M:%SZ)',
440+
'creators': ['Tool: codebase-memory-mcp-release-pipeline']
441+
},
442+
'packages': [
443+
{'SPDXID': 'SPDXRef-Package-sqlite3', 'name': 'sqlite3', 'versionInfo': '3.49.1', 'downloadLocation': 'https://sqlite.org', 'filesAnalyzed': False},
444+
{'SPDXID': 'SPDXRef-Package-yyjson', 'name': 'yyjson', 'versionInfo': '0.10.0', 'downloadLocation': 'https://github.com/ibireme/yyjson', 'filesAnalyzed': False},
445+
{'SPDXID': 'SPDXRef-Package-mongoose', 'name': 'mongoose', 'versionInfo': '7.16', 'downloadLocation': 'https://github.com/cesanta/mongoose', 'filesAnalyzed': False},
446+
{'SPDXID': 'SPDXRef-Package-mimalloc', 'name': 'mimalloc', 'versionInfo': '2.1.7', 'downloadLocation': 'https://github.com/microsoft/mimalloc', 'filesAnalyzed': False},
447+
{'SPDXID': 'SPDXRef-Package-xxhash', 'name': 'xxhash', 'versionInfo': '0.8.2', 'downloadLocation': 'https://github.com/Cyan4973/xxHash', 'filesAnalyzed': False},
448+
{'SPDXID': 'SPDXRef-Package-tre', 'name': 'tre', 'versionInfo': '0.8.0', 'downloadLocation': 'https://github.com/laurikari/tre', 'filesAnalyzed': False},
449+
{'SPDXID': 'SPDXRef-Package-tree-sitter', 'name': 'tree-sitter', 'versionInfo': '0.24.4', 'downloadLocation': 'https://github.com/tree-sitter/tree-sitter', 'filesAnalyzed': False}
445450
]
446451
}
447452
json.dump(sbom, open('sbom.json', 'w'), indent=2)
448453
"
449454
450-
# Note: SBOM is included as a release asset (sbom.json) but not
451-
# attested via attest-sbom — our minimal CycloneDX doesn't pass
452-
# the strict schema validation. Build provenance attestation
453-
# covers binary integrity; SBOM provides dependency transparency.
455+
- name: Attest SBOM
456+
uses: actions/attest-sbom@10926c72720ffc3f7b666661c8e55b1344e2a365 # v2
457+
with:
458+
subject-path: '*.tar.gz'
459+
sbom-path: 'sbom.json'
454460

455461
# ── Sigstore cosign signing ──────────────────────────────
456462
- name: Install cosign

0 commit comments

Comments
 (0)