-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (54 loc) · 2.17 KB
/
c4po-sbom.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: "Supply Chain Security C4PO SBOM Demo"
on:
pull_request:
branches: [ "main" ]
env:
REPORTING_PATH: security-c4po-reporting
CFG_PATH: security-c4po-cfg
jobs:
reporting_job:
name: "Reportingservice SBOM Job"
runs-on: ubuntu-latest
steps:
- name: "Check out code"
uses: actions/checkout@v3
# Steps required for build process
- name: "Set up JDK 11"
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: "Setup Gradle"
uses: gradle/gradle-build-action@v2
with:
gradle-version: 6.5
- name: "Execute Gradle build"
run: |
cd $REPORTING_PATH
./gradlew clean build
# Steps required for SBOM creation
- name: "Generate Reporting SBOM"
id: reporting_sbom
uses: anchore/sbom-action@v0
with:
path: './security-c4po-reporting'
format: cyclonedx-json
output-file: "${{ github.event.repository.name }}-reporting-sbom.cyclonedx.json"
upload-artifact: true
# Working version to generate & analyse SBOMs
# Might be not good for company data
- name: "Generate SBOM"
id: sbom_generation
uses: codenotary/sbom.sh-create@main
with:
scan_type: 'grypefs'
target: './security-c4po-reporting' # . -> Assuming you want to scan the entire repository
- name: Output SBOM URL
run: echo "The Reportingservice SBOM can be found at $SBOM_SHARE_URL"