Skip to content

Commit c230575

Browse files
SCAN4NET-967 Add .pre-commit-config.yaml (#2882)
Co-authored-by: Martin Strecker <103252490+martin-strecker-sonarsource@users.noreply.github.com>
1 parent ca3b53c commit c230575

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
default_install_hook_types: [pre-push]
2+
repos:
3+
- repo: https://github.com/SonarSource/sonar-secrets-pre-commit
4+
rev: v2.30.0.8284
5+
hooks:
6+
- id: sonar-secrets
7+
stages: [pre-push]

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,8 @@ In our CI/CD pipeline, we use the following:
6868
- SONARCLOUD_PROJECT_TOKEN=[user-token]
6969

7070
These can be set either on the operating system or your preferred IDE test run configuration.
71+
72+
## `sonar-secrets-pre-commit` hook
73+
74+
If you are Sonar internal use `sonar-secrets-pre-commit` to prevent pushing secrets to the repository. The hook is configured in [.pre-commit-hooks.yaml](.pre-commit-hooks.yaml). Follow the instructions in the [`sonar-secrets-pre-commit` README](https://github.com/SonarSource/sonar-secrets-pre-commit?tab=readme-ov-file) to activate it.
75+
Despite its name, the secrets check is configured as a pre-push hook.

0 commit comments

Comments
 (0)