-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,55 +12,65 @@ permissions: write-all | |
|
||
jobs: | ||
build: | ||
continue-on-error: true | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# Github Advanced Security Github Action | ||
- name: Run Github Advanced Security Github Action | ||
if: always() | ||
uses: advanced-security/[email protected] | ||
id: sbom | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
path: ${{steps.sbom.outputs.fileName }} | ||
name: "Github SBOM Generator Action.spdx.json" | ||
|
||
- name: Convert it into CycloneDX format | ||
if: always() | ||
run: docker run -t -v "${{steps.sbom.outputs.fileName }}":/tmp/sbom.spdx.json -v /tmp/ghas_action_sbom.cdx.json:/tmp/ghas_action_sbom.cdx.json cyclonedx/cyclonedx-cli:latest convert --input-file /tmp/sbom.spdx.json --output-file /tmp/ghas_action_sbom.cdx.json --input-format spdxjson --output-format json | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
path: /tmp/ghas_action_sbom.cdx.json | ||
name: "Github SBOM Generator Action SPDX.cdx.json" | ||
|
||
# Github Advanced Security CLI | ||
- name: Install Github CLI SBOM extension | ||
if: always() | ||
run: gh ext install advanced-security/gh-sbom | ||
|
||
- name: Run Github Advanced Security CLI SPDX | ||
if: always() | ||
run: gh sbom | jq '.' > /tmp/ghas_cli_sbom.spdx.json | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
path: /tmp/ghas_cli_sbom.spdx.json | ||
name: "Github SBOM CLI.spdx.json" | ||
|
||
- name: Convert it into CycloneDX format | ||
if: always() | ||
run: docker run -t -v /tmp/ghas_cli_sbom.spdx.json:/tmp/ghas_cli_sbom.spdx.json -v /tmp/ghas_cli_sbom_spdx.cdx.json:/tmp/ghas_cli_sbom_spdx.cdx.json cyclonedx/cyclonedx-cli:latest convert --input-file /tmp/ghas_cli_sbom.spdx.json --output-file /tmp/ghas_cli_sbom_spdx.cdx.json --input-format spdxjson --output-format json | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
path: /tmp/ghas_cli_sbom_spdx.cdx.json | ||
name: "Github SBOM CLI SPDX.cdx.json" | ||
|
||
- name: Run Github Advanced Security CLI CDX | ||
if: always() | ||
run: gh sbom -c -l | jq '.' > /tmp/ghas_cli_sbom.cdx.json | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
path: /tmp/ghas_cli_sbom.cdx.json | ||
name: "Github SBOM CLI.cdx.json" | ||
|