Skip to content

Commit 68b5c0b

Browse files
authored
Merge pull request #148 from BitGo/WP-6506-fossa-scan
feat: run fossa scans
2 parents b56025d + 6ed9b01 commit 68b5c0b

File tree

2 files changed

+44
-6
lines changed

2 files changed

+44
-6
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
description: 'Node.js version to use'
88
type: string
99
default: '22.1.0'
10+
secrets:
11+
fossa-api-key:
12+
description: 'API key used for Fossa scan'
1013

1114
jobs:
1215
commit-lint:
@@ -26,7 +29,7 @@ jobs:
2629
cache: 'npm'
2730

2831
- name: Cache dependencies
29-
uses: actions/cache@v3
32+
uses: actions/cache@v4
3033
id: node-modules-cache
3134
with:
3235
path: '**/node_modules'
@@ -55,7 +58,7 @@ jobs:
5558
cache: 'npm'
5659

5760
- name: Cache dependencies
58-
uses: actions/cache@v3
61+
uses: actions/cache@v4
5962
id: node-modules-cache
6063
with:
6164
path: '**/node_modules'
@@ -84,7 +87,7 @@ jobs:
8487
cache: 'npm'
8588

8689
- name: Cache dependencies
87-
uses: actions/cache@v3
90+
uses: actions/cache@v4
8891
id: node-modules-cache
8992
with:
9093
path: '**/node_modules'
@@ -113,7 +116,7 @@ jobs:
113116
cache: 'npm'
114117

115118
- name: Cache dependencies
116-
uses: actions/cache@v3
119+
uses: actions/cache@v4
117120
id: node-modules-cache
118121
with:
119122
path: '**/node_modules'
@@ -126,7 +129,7 @@ jobs:
126129
run: npm ci
127130

128131
- name: Run Trivy vulnerability scanner
129-
uses: aquasecurity/trivy-action@master
132+
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # v0.33.1
130133
with:
131134
scan-type: 'fs'
132135
scan-ref: '.'
@@ -136,6 +139,39 @@ jobs:
136139
ignore-unfixed: true
137140
scanners: 'vuln' # Only scan for vulnerabilities, not secrets
138141

142+
fossa-scan:
143+
name: License - Fossa Scan
144+
runs-on: ubuntu-latest
145+
steps:
146+
- name: Checkout
147+
uses: actions/checkout@v4
148+
149+
- name: Setup Node.js
150+
uses: actions/setup-node@v4
151+
with:
152+
node-version: ${{ inputs.node-version }}
153+
cache: 'npm'
154+
155+
- name: Cache dependencies
156+
uses: actions/cache@v4
157+
id: node-modules-cache
158+
with:
159+
path: '**/node_modules'
160+
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
161+
restore-keys: |
162+
${{ runner.os }}-modules-
163+
164+
- name: Install dependencies
165+
if: steps.node-modules-cache.outputs.cache-hit != 'true'
166+
run: npm ci
167+
168+
- name: Run Fossa Analysis
169+
uses: fossas/fossa-action@3ebcea1862c6ffbd5cf1b4d0bd6b3fe7bd6f2cac # v1.7.0
170+
with:
171+
api-key: ${{ secrets.fossa-api-key }}
172+
branch: ${{ github.head_ref || github.ref_name }}
173+
project: BitGo/advanced-wallets
174+
139175
test:
140176
name: Test
141177
runs-on: ubuntu-latest
@@ -150,7 +186,7 @@ jobs:
150186
cache: 'npm'
151187

152188
- name: Cache dependencies
153-
uses: actions/cache@v3
189+
uses: actions/cache@v4
154190
id: node-modules-cache
155191
with:
156192
path: '**/node_modules'

.github/workflows/pull_request.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ jobs:
1515
build-and-test:
1616
name: Build & Test (CI)
1717
uses: ./.github/workflows/build-and-test.yaml
18+
secrets:
19+
fossa-api-key: ${{ secrets.FOSSA_API_KEY }}

0 commit comments

Comments
 (0)