Skip to content
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
48 changes: 42 additions & 6 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
description: 'Node.js version to use'
type: string
default: '22.1.0'
secrets:
fossa-api-key:
description: 'API key used for Fossa scan'

jobs:
commit-lint:
Expand All @@ -26,7 +29,7 @@ jobs:
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: node-modules-cache
with:
path: '**/node_modules'
Expand Down Expand Up @@ -55,7 +58,7 @@ jobs:
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: node-modules-cache
with:
path: '**/node_modules'
Expand Down Expand Up @@ -84,7 +87,7 @@ jobs:
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: node-modules-cache
with:
path: '**/node_modules'
Expand Down Expand Up @@ -113,7 +116,7 @@ jobs:
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: node-modules-cache
with:
path: '**/node_modules'
Expand All @@ -126,7 +129,7 @@ jobs:
run: npm ci

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # v0.33.1
with:
scan-type: 'fs'
scan-ref: '.'
Expand All @@ -136,6 +139,39 @@ jobs:
ignore-unfixed: true
scanners: 'vuln' # Only scan for vulnerabilities, not secrets

fossa-scan:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does it configure the severity?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be configured here

name: License - Fossa Scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v4
id: node-modules-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-

- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Run Fossa Analysis
uses: fossas/fossa-action@3ebcea1862c6ffbd5cf1b4d0bd6b3fe7bd6f2cac # v1.7.0
with:
api-key: ${{ secrets.fossa-api-key }}
branch: ${{ github.head_ref || github.ref_name }}
project: BitGo/advanced-wallets

test:
name: Test
runs-on: ubuntu-latest
Expand All @@ -150,7 +186,7 @@ jobs:
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: node-modules-cache
with:
path: '**/node_modules'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ jobs:
build-and-test:
name: Build & Test (CI)
uses: ./.github/workflows/build-and-test.yaml
secrets:
fossa-api-key: ${{ secrets.FOSSA_API_KEY }}