Skip to content

Commit

Permalink
💚 (repo): Generate SBOM when lockfile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
valpinkman committed Oct 3, 2024
1 parent 5e224ba commit 9800282
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
28 changes: 28 additions & 0 deletions .github/actions/generate-sbom-composite/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Download SBOM from Github"
description: "Download the SBOM from Github API"
author: "valpinkman"
inputs:
owner:
description: "The owner of the repository"
required: true
repo:
description: "The repository name"
required: true

runs:
using: "composite"
steps:

- name: Download SBOM
shell: bash
run: |
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ inputs.owner }}/${{ inputs.repo }}/dependency-graph/sbom > sbom.json
- name: Upload SBOM
uses: actions/upload-artifact@v4
with:
name: sbom
path: sbom.json
17 changes: 17 additions & 0 deletions .github/workflows/generate_sbom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Generate SBOM

on:
pull_request:

jobs:
generate-sbom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: LedgerHQ/device-sdk-ts/.github/actions/setup-toolchain-composite@develop

- uses: ./.github/actions/generate-sbom-composite
with:
owner: "LedgerHQ"
repo: "device-sdk-ts"
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ jobs:

- uses: LedgerHQ/device-sdk-ts/.github/actions/setup-toolchain-composite@develop

- name: install dependencies
run: pnpm install

- name: build libraries
run: pnpm build
run: pnpm build:libs

- name: Login to internal JFrog registry
id: jfrog-login
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ lib
.eslintcache

# npm config
.npmrc
.npmrc

# sbom
sbom.json

0 comments on commit 9800282

Please sign in to comment.