Skip to content

Commit 2ad38d2

Browse files
committed
Add(secret-scan): Github workflow
1 parent febee3c commit 2ad38d2

File tree

5 files changed

+68
-10
lines changed

5 files changed

+68
-10
lines changed

.github/workflows/secret-scan.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Secret Scan
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
gitleaks:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Install Gitleaks
20+
run: |
21+
curl -sSfL https://github.com/zricethezav/gitleaks/releases/download/v8.2.0/gitleaks_8.2.0_linux_x64.tar.gz | tar -xz -C /usr/local/bin gitleaks
22+
23+
- name: Run Gitleaks
24+
run: gitleaks detect --source . --report-path gitleaks-report.json
25+
26+
# trufflehog:
27+
# if: github.event_name == 'workflow_dispatch'
28+
# runs-on: ubuntu-latest
29+
# steps:
30+
# - name: Checkout code
31+
# uses: actions/checkout@v3
32+
#
33+
# - name: Install TruffleHog
34+
# run: |
35+
# pip install truffleHog
36+
#
37+
# - name: Run TruffleHog
38+
# run: trufflehog git --repo-path . --json > trufflehog-report.json

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@
99
<p align="center">
1010
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
1111
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
12-
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
13-
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
14-
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
15-
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
16-
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
17-
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
18-
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
19-
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a>
12+
<a href="https://github.com/building-for-fun/StoreZero/actions/workflows/secret-scan.yml" target="_blank"><img src="https://github.com/building-for-fun/StoreZero/actions/workflows/secret-scan.yml/badge.svg" alt="Secret Scan" /></a>
13+
2014
</p>
2115
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
2216
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->

jest.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
displayName: 'unit',
3+
testMatch: ['**/*.spec.ts'],
4+
moduleFileExtensions: ['js', 'json', 'ts'],
5+
rootDir: 'src',
6+
transform: {
7+
'^.+\\.(t|j)s$': 'ts-jest',
8+
},
9+
collectCoverageFrom: ['**/*.(t|j)s'],
10+
coverageDirectory: '../coverage/unit',
11+
testEnvironment: 'node',
12+
};

jest.integration.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
displayName: 'integration',
3+
testMatch: ['**/*.integration.spec.ts'],
4+
moduleFileExtensions: ['js', 'json', 'ts'],
5+
rootDir: 'src',
6+
transform: {
7+
'^.+\\.(t|j)s$': 'ts-jest',
8+
},
9+
collectCoverageFrom: ['**/*.(t|j)s'],
10+
coverageDirectory: '../coverage/integration',
11+
testEnvironment: 'node',
12+
};

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
"start:debug": "nest start --debug --watch",
1414
"start:prod": "node dist/main",
1515
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
16-
"test": "jest",
16+
"test": "npm run test:unit && npm run test:integration",
1717
"test:watch": "jest --watch",
1818
"test:cov": "jest --coverage",
1919
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
2020
"test:e2e": "jest --config ./test/jest-e2e.json",
21-
"prepare": "husky"
21+
"prepare": "husky",
22+
"test:unit": "jest --config jest.config.js --coverage",
23+
"test:integration": "jest --config jest.integration.config.js"
2224
},
2325
"dependencies": {
2426
"@nestjs/common": "^11.0.1",

0 commit comments

Comments
 (0)