Skip to content

feat(ci): add audit job for security #3042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 6, 2021
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
9 changes: 9 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ jobs:
with:
args: ./ci/steps/lint.sh

audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Audit for vulnerabilities
uses: ./ci/images/debian10
with:
args: ./ci/steps/audit.sh

test-unit:
runs-on: ubuntu-latest
steps:
Expand Down
12 changes: 12 additions & 0 deletions ci/dev/audit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail

main() {
cd "$(dirname "$0")/../.."

# Prevents integration with moderate or higher vulnerabilities
# Docs: https://github.com/IBM/audit-ci#options
yarn audit-ci --moderate
}

main "$@"
1 change: 1 addition & 0 deletions ci/dev/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ main() {

yarn fmt
yarn lint
yarn _audit
yarn test:unit
}

Expand Down
12 changes: 12 additions & 0 deletions ci/steps/audit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail

main() {
cd "$(dirname "$0")/../.."

yarn --frozen-lockfile

yarn _audit
}

main "$@"
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"postinstall": "./ci/dev/postinstall.sh",
"update:vscode": "./ci/dev/update-vscode.sh",
"_____": "",
"_audit": "./ci/dev/audit.sh",
"fmt": "./ci/dev/fmt.sh",
"lint": "./ci/dev/lint.sh",
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
Expand Down Expand Up @@ -54,6 +55,7 @@
"@types/wtfnode": "^0.7.0",
"@typescript-eslint/eslint-plugin": "^4.7.0",
"@typescript-eslint/parser": "^4.7.0",
"audit-ci": "^3.1.1",
"doctoc": "^2.0.0",
"eslint": "^7.7.0",
"eslint-config-prettier": "^8.1.0",
Expand Down
Loading