Skip to content

Commit 9c53133

Browse files
committed
PHPLIB-1688: Updating Release pipeline with SBOM generation steps
1 parent e5d1b94 commit 9c53133

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Generate SBOM
2+
description: Generates CycloneDX SBOM using CycloneDX PHP Composer plugin
3+
inputs:
4+
output-file:
5+
description: "Output filename for the SBOM"
6+
required: false
7+
default: "sbom.json"
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Allow CycloneDX plugin
12+
shell: bash
13+
run: ./composer config allow-plugins.cyclonedx/cyclonedx-php-composer true
14+
- name: Install CycloneDX plugin
15+
shell: bash
16+
run: ./composer require --dev cyclonedx/cyclonedx-php-composer --ignore-platform-reqs
17+
- name: Generate SBOM
18+
shell: bash
19+
working-directory: ${{ inputs.working-directory }}
20+
run: |
21+
echo "Generating SBOM for 'php' project..."
22+
./composer CycloneDX:make-sbom --output-file=${{ inputs.output-file }} --output-format=json --spec-version=1.5
23+
- name: Validate SBOM presence
24+
shell: bash
25+
run: |
26+
if [ ! -f "${{ inputs.output-file }}" ]; then
27+
echo "Error: SBOM file not found"
28+
exit 1
29+
fi
30+
31+
echo "SBOM file validated: ${{ inputs.output-file }}"

0 commit comments

Comments
 (0)