Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ’š (repo) [DSDK-498]: Generate SBOM when lockfile changes #351

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/actions/generate-sbom-composite/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Download SBOM from Github"
description: "Download the SBOM from Github API"
author: "valpinkman"
inputs:
owner:
default: "LedgerHQ"
description: "The owner of the repository"
required: true
repo:
default: "device-sdk-ts"
description: "The repository name"
required: true
token:
default: ${{ github.token }}
description: "The Github token to use to download the SBOM"
required: true

runs:
using: "composite"
steps:

- name: Download SBOM
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}
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
18 changes: 18 additions & 0 deletions .github/workflows/generate_sbom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Generate SBOM

on:
push:
branches:
- develop
paths:
- "pnpm-lock.yaml"

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
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