Skip to content

Commit e865338

Browse files
authored
chore: add sbom generation and upload workflow (#821)
Signed-off-by: Ioana Iliescu <[email protected]>
1 parent f20fef3 commit e865338

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Generate Maven SBOM
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: "Version"
10+
default: "main"
11+
required: true
12+
13+
env:
14+
JAVA_VERSION: '11'
15+
JAVA_DISTRO: 'temurin'
16+
PRODUCT_PATH: './'
17+
PLUGIN_VERSION: '2.7.8'
18+
SBOM_TYPE: 'makeAggregateBom'
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
generate-sbom:
25+
runs-on: ubuntu-latest
26+
outputs:
27+
project-version: ${{ steps.version.outputs.PROJECT_VERSION }}
28+
steps:
29+
- name: Extract version
30+
id: version
31+
run: |
32+
VERSION="${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.version }}"
33+
echo "PROJECT_VERSION=$VERSION" >> $GITHUB_OUTPUT
34+
echo "Product version: $VERSION"
35+
- name: Checkout repository
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
with:
38+
fetch-depth: 0
39+
ref: ${{ steps.version.outputs.PROJECT_VERSION }}
40+
41+
- name: Setup Java SDK
42+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
43+
with:
44+
java-version: ${{ env.JAVA_VERSION }}
45+
distribution: ${{ env.JAVA_DISTRO }}
46+
47+
- name: Generate sbom
48+
run: |
49+
mvn org.cyclonedx:cyclonedx-maven-plugin:$PLUGIN_VERSION:$SBOM_TYPE -f "$PRODUCT_PATH/pom.xml"
50+
51+
- name: Upload sbom
52+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
53+
with:
54+
name: sbom
55+
path: ${{ env.PRODUCT_PATH }}/target/bom.json
56+
57+
store-sbom-data: # stores sbom and metadata in a predefined format for otterdog to pick up
58+
needs: ['generate-sbom']
59+
uses: eclipse-csi/workflows/.github/workflows/store-sbom-data.yml@main
60+
with:
61+
projectName: 'che-server'
62+
projectVersion: ${{ needs.generate-sbom.outputs.project-version }}
63+
bomArtifact: 'sbom'
64+
bomFilename: 'bom.json'
65+
parentProject: '1ab66138-685e-47bb-9020-feb6ca1fb40c'

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,7 @@ Here are additional useful links with the `che-server` builds data:
5050
- [Trends dashboard](https://develocity-staging.eclipse.org/scans/trends?search.rootProjectNames=che%20server)
5151
- [Failures dashboard](https://develocity-staging.eclipse.org/scans/failures?search.rootProjectNames=che%20server)
5252
- Failed and flaky [Tests dashboard](https://develocity-staging.eclipse.org/scans/tests?search.rootProjectNames=che%20server)
53+
54+
## SBOM
55+
56+
To enhance supply chain security and offer users clear insight into project components, Eclipse Che now generates a Software Bill of Materials (SBOM) for every release. These are published to the Eclipse Foundation SBOM registry, with access instructions and usage details available in this [documentation](https://eclipse-csi.github.io/security-handbook/sbom/registry.html).

0 commit comments

Comments
 (0)