Skip to content

Commit ffe3a10

Browse files
committed
Try another way
1 parent 63b1541 commit ffe3a10

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

.github/actions/sbom/action.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@ inputs:
99
outputs:
1010
sbom-path:
1111
description: The path to the generated SBOM file
12-
value: ${{ steps.path.outputs.OUTPUT_PATH }}
12+
value: ${{ steps.generate-sbom.outputs.OUTPUT_PATH }}
1313

1414
runs:
1515
using: "composite"
1616
steps:
17-
- name: Set path for SBOM
18-
id: path
19-
shell: bash
20-
run: echo "OUTPUT_PATH=$(mktemp -d)/sbom.json" >> $GITHUB_OUTPUT
17+
- name: Setup Syft
18+
id: setup-syft
19+
uses: anchore/sbom-action/download-syft@f8bdd1d8ac5e901a77a92f111440fdb1b593736b # v0
2120

22-
- uses: anchore/sbom-action@v0
23-
with:
24-
image: ${{ inputs.image-ref }}
25-
output-file: ${{ steps.path.outputs.OUTPUT_PATH }}
26-
format: spdx-json
21+
- name: Generate SBOM
22+
id: generate-sbom
23+
env:
24+
SYFT_CMD: ${{ steps.setup-syft.outputs.cmd }}
25+
shell: bash
26+
run: |
27+
OUTPUT_PATH="`$(mktemp -d)/sbom.json`"
28+
export SYFT_PARALLELISM=$(($(nproc)*2))
29+
$SYFT_CMD ${{ inputs.image-ref }} --select-catalogers "rpm,+sbom-cataloger" -o spdx-json=${OUTPUT_PATH}
30+
echo "OUTPUT_PATH=${OUTPUT_PATH}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)