File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ outputs:
1414 artifact-name :
1515 description : " Name of the artifact upload"
1616 value : ${{steps.artifact-name.outputs.artifact-name}}
17+ cyclone-artifact-id :
18+ description : " ID of the sbom artifact"
19+ value : ${{steps.upload-sbom-artifact.outputs.artifact-id}}
20+ cyclone-path :
21+ description : " path of the sbom"
22+ value : ${{steps.artifact-name.outputs.cyclone-path}}
1723
1824runs :
1925 using : " composite"
3642 shell : bash
3743 - id : artifact-name
3844 name : Set output variable $GITHUB_OUTPUT
39- run : echo "artifact-name=${{hashFiles(format('./{0}/pom.xml', inputs.app-path))}}" >> "$GITHUB_OUTPUT"
45+ env :
46+ APP_PATH : ${{inputs.app-path}}
47+ run : |
48+ echo "artifact-name=${{hashFiles(format('./{0}/pom.xml', inputs.app-path))}}" >> "$GITHUB_OUTPUT"
49+ echo "cyclone-path=$APP_PATH/target/classes/META-INF/sbom/application.cdx.json" >> "$GITHUB_OUTPUT"
4050 shell : bash
4151 - id : upload-artifact
4252 name : Upload artifact
4555 name : ${{steps.artifact-name.outputs.artifact-name}}
4656 path : " **/target"
4757 retention-days : 5
58+ - id : upload-sbom-artifact
59+ name : upload-sbom-artifact
60+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
61+ with :
62+ name : ${{inputs.app-path}}
63+ path : " ${{inputs.app-path}}/target/classes/META-INF/sbom/application.cdx.json"
64+ retention-days : 5
65+ archive : false
Original file line number Diff line number Diff line change @@ -26,7 +26,12 @@ outputs:
2626 artifact-name :
2727 description : " Name of the artifact upload"
2828 value : ${{steps.artifact-name.outputs.artifact-name}}
29-
29+ cyclone-artifact-id :
30+ description : " ID of the sbom artifact"
31+ value : ${{steps.upload-sbom-artifact.outputs.artifact-id}}
32+ cyclone-path :
33+ value : ${{steps.artifact-name.outputs.cyclone-path}}
34+ description : " path of the sbom"
3035runs :
3136 using : " composite"
3237 steps :
@@ -61,11 +66,22 @@ runs:
6166 shell : bash
6267 - id : artifact-name
6368 name : Sets output variable $GITHUB_OUTPUT
64- run : echo "artifact-name=${{hashFiles(format('./{0}/package.json', inputs.app-path))}}" >> "$GITHUB_OUTPUT"
69+ env :
70+ APP_PATH : ${{inputs.app-path}}
71+ run : |
72+ echo "artifact-name=${{hashFiles(format('./{0}/package.json', inputs.app-path))}}" >> "$GITHUB_OUTPUT"
73+ echo "cyclone-path=$APP_PATH/dist/application.cdx.json" >> "$GITHUB_OUTPUT"
6574 shell : bash
6675 - name : Upload artifact
6776 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
6877 with :
6978 name : ${{steps.artifact-name.outputs.artifact-name}}
7079 path : " **/dist"
7180 retention-days : 5
81+ - id : upload-sbom-artifact
82+ name : upload-sbom-artifact
83+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
84+ with :
85+ path : " ${{inputs.app-path}}/dist/application.cdx.json"
86+ retention-days : 5
87+ archive : false
Original file line number Diff line number Diff line change @@ -15,14 +15,19 @@ inputs:
1515 required : false
1616 default : " false"
1717 path :
18- description : " Path to scan with Trivy"
18+ description : " Path to scan with Trivy. For scan-type=sbom, this must point to a specific SBOM file (e.g. sbom.cdx.json), not a directory. "
1919 required : false
2020 default : " ."
21+ scan-type :
22+ description : " scan type, e.g. fs or sbom"
23+ required : false
24+ default : " fs"
2125
2226runs :
2327 using : " composite"
2428 steps :
2529 - name : Checkout repository
30+ if : inputs.scan-type == 'fs'
2631 uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2732 with :
2833 fetch-depth : 0 # Required for vitepress lastUpdated
3237 env :
3338 TRIVY_INCLUDE_DEV_DEPS : " true"
3439 with :
35- scan-type : " fs "
36- scan-ref : ${{ inputs.path }}
40+ scan-type : " ${{ inputs.scan-type }} "
41+ scan-ref : " ${{ inputs.path }}"
3742 format : " json"
3843 exit-code : ${{ inputs.allow-failure == 'true' && '0' || '1' }}
3944 timeout : " ${{ inputs.timeout }}"
Original file line number Diff line number Diff line change @@ -428,6 +428,8 @@ Executes the following steps:
428428Output parameters :
429429
4304301. `artifact-name` : Name of the uploaded artifact
431+ 2. `cyclone-artifact-id` : ID of the sbom artifact
432+ 3. `cyclone-path` : path of the sbom
431433
432434Workflows using that action need the following permissions :
433435
@@ -533,6 +535,8 @@ Executes the following steps:
533535Output parameters :
534536
5355371. `artifact-name` : Name of the uploaded artifact
538+ 2. `cyclone-artifact-id` : ID of the sbom artifact
539+ 3. `cyclone-path` : path of the sbom
536540
537541Workflows using that action need the following permissions :
538542
@@ -674,6 +678,9 @@ Workflows using that action need the following permissions:
674678 # If the action should succeed even if Trivy fails
675679 # Default: false
676680 allow-failure: "false"
681+ # scan type, e.g. fs or sbom
682+ # defualt: fs
683+ scan-type: fs
677684 # Path to scan with Trivy
678685 # Default: .
679686 path: "."
You can’t perform that action at this time.
0 commit comments