Skip to content

Commit e713d38

Browse files
authored
Merge branch 'main' into fix-issue-700
2 parents 30dc1ce + 2393303 commit e713d38

File tree

11 files changed

+3520
-5176
lines changed

11 files changed

+3520
-5176
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build and Upload SBOMs to Dependency-Track
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
sbom:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v5
15+
16+
# Node.js SBOM
17+
- name: Use Node.js
18+
uses: actions/setup-node@v6
19+
with:
20+
node-version-file: .nvmrc
21+
check-latest: true
22+
cache: 'npm'
23+
24+
- run: npm install
25+
26+
- name: Install CycloneDX Node.js CLI
27+
run: npm i -g @cyclonedx/cyclonedx-npm
28+
29+
- name: Generate SBOM for Node.js (frontend)
30+
run: npx @cyclonedx/cyclonedx-npm -o sbom.xml
31+
32+
# Upload Node.js SBOM (if exists)
33+
- name: Upload Node.js SBOM to Dependency-Track
34+
env:
35+
DTRACK_API_URI: ${{ vars.DTRACK_API_URI }}
36+
DTRACK_API_KEY: ${{ secrets.DTRACK_API_KEY }}
37+
run: |
38+
if [ -f ./sbom.xml ]; then
39+
echo "Uploading to: $DTRACK_API_URI"
40+
echo "Project: ${{ github.event.repository.name }}"
41+
echo "Version: ${{ github.ref_name }}"
42+
curl --fail-with-body -v -i -w "\nHTTP Status: %{http_code}\n" \
43+
"$DTRACK_API_URI" \
44+
-H "X-Api-Key: $DTRACK_API_KEY" \
45+
-H "accept: application/json" \
46+
-H "Content-Type: multipart/form-data" \
47+
-F "autoCreate=true" \
48+
-F "projectName=${{ github.event.repository.name }}" \
49+
-F "projectVersion=${{ github.ref_name }}" \
50+
-F "bom=@./sbom.xml"
51+
else
52+
echo "No frontend SBOM to upload."
53+
fi

.storybook/main.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import type { StorybookConfig } from '@storybook/web-components-vite';
22
import remarkGfm from 'remark-gfm';
3+
import { fileURLToPath } from 'node:url';
34

4-
const config: StorybookConfig = {
5+
const config: StorybookConfig & {
6+
managerEntries?: (entry?: string[]) => string[];
7+
} = {
58
stories: [
69
'../packages/**/*.mdx',
710
'../packages/**/*.story.@(js|jsx|mjs|ts|tsx)',
@@ -24,9 +27,17 @@ const config: StorybookConfig = {
2427
'@storybook/addon-links',
2528
'@storybook/addon-a11y',
2629
'@chromatic-com/storybook',
27-
'../storyhelpers/storybook-readme',
2830
],
2931

32+
managerEntries(entry = []) {
33+
return [
34+
...entry,
35+
fileURLToPath(
36+
import.meta.resolve('../storyhelpers/storybook-readme/manager.ts'),
37+
),
38+
];
39+
},
40+
3041
framework: {
3142
name: '@storybook/web-components-vite',
3243
options: {},

0 commit comments

Comments
 (0)