-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (79 loc) · 2.43 KB
/
pull_request.yaml
File metadata and controls
91 lines (79 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: on_pr
run-name: "on_pr: ${{ github.event.pull_request.number }}"
on:
pull_request:
permissions:
actions: read # required by BitGo/build-system
contents: read # required by BitGo/build-system
id-token: write # required by BitGo/build-system
pull-requests: write # required by Grype PR commenter
packages: read # required for ArgoCD deploy
jobs:
build-and-test:
name: Build & Test (CI)
uses: ./.github/workflows/build-and-test.yaml
secrets:
fossa-api-key: ${{ secrets.FOSSA_API_KEY }}
check-dependency-changes:
name: Check for dependency changes
runs-on: ubuntu-latest
outputs:
deps-changed: ${{ steps.filter.outputs.deps }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check for dependency file changes
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
deps:
- 'package.json'
- 'package-lock.json'
- 'Dockerfile'
trivy-scan:
name: Security - Trivy Scan
needs: check-dependency-changes
if: needs.check-dependency-changes.outputs.deps-changed == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.1.0'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
with:
scan-type: 'fs'
scan-ref: '.'
format: 'table'
severity: 'CRITICAL,HIGH'
exit-code: '1'
ignore-unfixed: true
scanners: 'vuln'
build-docker-image:
name: Build the Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: false
tags: |
ghcr.io/bitgo/advanced-wallets:${{ github.sha }}
build-args: |
BUILD_VERSION=${{ github.sha }}
BUILD_DATE=${{ github.event.repository.updated_at }}
VCS_REF=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max