Skip to content

Commit 9f367c8

Browse files
build: added SFW in the build pipeline
Ticket: VL-3832
1 parent 8b5d8de commit 9f367c8

File tree

3 files changed

+41
-12
lines changed

3 files changed

+41
-12
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
node-version: [20.x, 22.x]
2525

2626
steps:
27+
- uses: socketdev/action@v1
28+
with:
29+
mode: firewall-free
30+
2731
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2832
with:
2933
ref: ${{ github.event.pull_request.head.sha }}
@@ -58,7 +62,7 @@ jobs:
5862

5963
- name: Install Packages
6064
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')
61-
run: yarn install --with-frozen-lockfile --ignore-scripts
65+
run: sfw yarn install --with-frozen-lockfile --ignore-scripts
6266

6367
- name: Check In-Repo Package Versions
6468
run: yarn run check-versions
@@ -90,6 +94,10 @@ jobs:
9094
check: ['lint', 'format', 'commit-lint', 'dependencies', 'audit']
9195

9296
steps:
97+
- uses: socketdev/action@v1
98+
with:
99+
mode: firewall-free
100+
93101
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
94102
with:
95103
ref: ${{ github.event.pull_request.head.sha }}
@@ -110,7 +118,7 @@ jobs:
110118

111119
- name: Install Packages
112120
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')
113-
run: yarn install --with-frozen-lockfile --ignore-scripts
121+
run: sfw yarn install --with-frozen-lockfile --ignore-scripts
114122

115123
- name: Lint Source Code
116124
if: matrix.check == 'lint'
@@ -138,6 +146,10 @@ jobs:
138146
runs-on: ubuntu-latest
139147

140148
steps:
149+
- uses: socketdev/action@v1
150+
with:
151+
mode: firewall-free
152+
141153
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
142154

143155
- name: Setup node 22
@@ -156,7 +168,7 @@ jobs:
156168

157169
- name: Install Packages
158170
if: steps.lerna-cache.outputs.cache-hit != 'true'
159-
run: yarn install --with-frozen-lockfile --ignore-scripts
171+
run: sfw yarn install --with-frozen-lockfile --ignore-scripts
160172

161173
- name: build packages
162174
env:
@@ -175,6 +187,10 @@ jobs:
175187
runs-on: ubuntu-22.04
176188

177189
steps:
190+
- uses: socketdev/action@v1
191+
with:
192+
mode: firewall-free
193+
178194
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
179195
with:
180196
ref: ${{ github.event.pull_request.head.sha }}
@@ -249,7 +265,7 @@ jobs:
249265

250266
- name: Install Packages
251267
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')
252-
run: yarn install --with-frozen-lockfile
268+
run: sfw yarn install --with-frozen-lockfile
253269

254270
- name: build packages
255271
if: steps.lerna-cache.outputs.cache-hit == 'true'
@@ -338,6 +354,10 @@ jobs:
338354
runs-on: ubuntu-latest
339355

340356
steps:
357+
- uses: socketdev/action@v1
358+
with:
359+
mode: firewall-free
360+
341361
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
342362
with:
343363
ref: ${{ github.event.pull_request.head.sha }}
@@ -358,7 +378,7 @@ jobs:
358378

359379
- name: Install Packages
360380
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')
361-
run: yarn install --with-frozen-lockfile --ignore-scripts
381+
run: sfw yarn install --with-frozen-lockfile --ignore-scripts
362382

363383
- name: Check Dockerfile is up to date
364384
run: |
@@ -373,6 +393,10 @@ jobs:
373393
runs-on: ubuntu-latest
374394

375395
steps:
396+
- uses: socketdev/action@v1
397+
with:
398+
mode: firewall-free
399+
376400
- name: Checkout PR
377401
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
378402
with:
@@ -394,15 +418,15 @@ jobs:
394418

395419
- name: Install Packages
396420
if: steps.lerna-cache.outputs.cache-hit != 'true'
397-
run: yarn install --with-frozen-lockfile --ignore-scripts
421+
run: sfw yarn install --with-frozen-lockfile --ignore-scripts
398422

399423
- name: Build packages
400424
env:
401425
DISABLE_V8_COMPILE_CACHE: '1'
402426
run: yarn run postinstall
403427

404428
- name: Install OpenAPI Generator at root
405-
run: yarn add -W @api-ts/openapi-generator@v5
429+
run: sfw yarn add -W @api-ts/openapi-generator@v5
406430

407431
- name: Download and install vacuum v0.18.1
408432
run: |

.github/workflows/publish.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20+
- uses: socketdev/action@v1
21+
with:
22+
mode: firewall-free
23+
2024
- name: Checkout repository
2125
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2226

@@ -26,7 +30,7 @@ jobs:
2630
node-version-file: .nvmrc
2731

2832
- name: Install BitGoJS
29-
run: yarn install --with-frozen-lockfile
33+
run: sfw yarn install --with-frozen-lockfile
3034

3135
- name: Set Environment Variable for Alpha
3236
if: github.ref != 'refs/heads/master' # only publish changes if on feature branches
@@ -56,7 +60,7 @@ jobs:
5660
npx tsx ./scripts/prepare-release.ts ${{ env.preid }}
5761
5862
- name: Rebuild packages
59-
run: yarn
63+
run: sfw yarn
6064

6165
- name: Commit Local Changes
6266
run: git commit -am "Auto updated ${{ env.preid }} branch" --no-verify || echo "No changes to commit"

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@ RUN find modules \! -name "package.json" -mindepth 2 -maxdepth 2 -print | xargs
1414

1515
FROM node:22.16.0-bookworm-slim@sha256:2f3571619daafc6b53232ebf2fcc0817c1e64795e92de317c1684a915d13f1a5 AS builder
1616
RUN apt-get update && apt-get install -y git python3 make g++ libtool autoconf automake
17+
RUN npm install -g @socketregistry/sfw
1718
WORKDIR /tmp/bitgo
1819
COPY --from=filter-packages-json /tmp/bitgo .
1920
# (skip postinstall) https://github.com/yarnpkg/yarn/issues/4100#issuecomment-388944260
20-
RUN NOYARNPOSTINSTALL=1 yarn install --pure-lockfile --network-timeout 120000
21+
RUN NOYARNPOSTINSTALL=1 sfw yarn install --pure-lockfile --network-timeout 120000
2122

2223
COPY . .
2324
RUN \
2425
# clean up unnecessary local node_modules and dist
2526
rm -rf modules/**/node_modules modules/**/dist && \
2627
# install with dev deps so we can run the prepare script
27-
yarn install --frozen-lockfile && \
28+
sfw yarn install --frozen-lockfile && \
2829
# install again to prune dev deps
29-
yarn install --production --frozen-lockfile --non-interactive --ignore-scripts && \
30+
sfw yarn install --production --frozen-lockfile --non-interactive --ignore-scripts && \
3031
# remove any src code leftover (we only want dist)
3132
rm -r modules/*/src
3233

0 commit comments

Comments
 (0)