-
Notifications
You must be signed in to change notification settings - Fork 161
chore: add pre-commit hooks [MCP-284] #727
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
Changes from 8 commits
c940a4b
d182dee
5bad587
db0999d
d2bf0ad
c07215b
d19055a
042e0c9
7a7b79d
f3de062
f0a27ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,3 +136,23 @@ jobs: | |
| uses: coverallsapp/github-action@v2.3.6 | ||
| with: | ||
| file: coverage/lcov.info | ||
|
|
||
| run-git-hooks: | ||
| name: Run git hooks | ||
| if: github.event_name == 'push' || (github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: GitHubSecurityLab/actions-permissions/monitor@v1 | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: package.json | ||
| cache: "npm" | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get install -y git-secrets | ||
| npm ci | ||
| - name: Run pre-commit and pre-push hooks | ||
|
||
| run: ./.husky/_/pre-commit && ./.husky/_/pre-push | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/bash | ||
|
|
||
| if [ ! "$(which git-secrets)" ] | ||
| then | ||
| echo "git-secrets is not installed. Please run 'brew install git-secrets' or visit https://github.com/awslabs/git-secrets#installing-git-secrets" | ||
| exit 1 | ||
| fi | ||
|
|
||
| git-secrets --register-aws > /dev/null | ||
| git-secrets --scan |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| npm run check | ||
| npm test -- --run tests/unit |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,8 @@ export class HTTPServerProxyTestSetup { | |
| } | ||
|
|
||
| requests: IncomingMessage[]; | ||
|
|
||
| // note: these are self-signed certs for testing purposes, DO NOT use in production | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @blva is this enough? |
||
| tlsOptions = Object.freeze({ | ||
| key: readFileSync(path.resolve(__dirname, "server.key")), | ||
| cert: readFileSync(path.resolve(__dirname, "server.pem")), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to install npm packages? I don't expect we want to scan for secrets in node_modules anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will remove