Skip to content

Commit

Permalink
Please just do all the steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Amndeep7 authored Oct 4, 2024
1 parent 27aa579 commit 604d2b5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 604d2b5

Please sign in to comment.