Skip to content

Commit 2dc72eb

Browse files
authored
Add audit check to CI and pre-push Git hook (#185)
1 parent 5b6f8e1 commit 2dc72eb

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

.github/workflows/super_diff.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ jobs:
3131
run: yarn --immutable
3232
- name: Lint
3333
run: yarn lint
34+
audit:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v3
38+
- name: Set up Ruby
39+
uses: ruby/setup-ruby@v1
40+
with:
41+
bundler-cache: true
42+
- name: Use Node.js
43+
uses: actions/setup-node@v3
44+
with:
45+
node-version-file: ".nvmrc"
46+
cache: "yarn"
47+
- name: Install Ruby dependencies
48+
run: bin/ci/install
49+
- name: Install Yarn dependencies
50+
run: yarn --immutable
51+
- name: Audit
52+
run: yarn audit
3453
test:
3554
needs:
3655
- lint

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
77
gem "appraisal",
88
github: "thoughtbot/appraisal",
99
ref: "2f5be65b8e127bd602fd149f395f2f8fa50616a8"
10+
gem "bundler-audit"
1011
gem "childprocess"
1112
gem "climate_control"
1213
gem "pry-byebug", platform: :mri

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
"private": true,
66
"scripts": {
77
"lint": "prettier --check .",
8+
"audit": "yarn npm audit && bundle exec bundle audit",
89
"lint:fix": "yarn lint --write"
910
},
1011
"simple-git-hooks": {
11-
"pre-push": "yarn lint"
12+
"pre-push": "yarn lint && yarn audit"
1213
},
1314
"devDependencies": {
1415
"@lavamoat/allow-scripts": "^2.3.0",

0 commit comments

Comments
 (0)