-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aba2494
commit 3030623
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ jobs: | |
with: | ||
python-version: '3.9' | ||
- uses: pre-commit/[email protected] | ||
env: | ||
SKIP: "trufflehog" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "Secret Scanning" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_call: | ||
|
||
jobs: | ||
check_commits: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set depth and branch variables | ||
run: | | ||
if [ "${{ github.event_name }}" == "push" ]; then | ||
echo "depth=$(($(jq length <<< '${{ toJson(github.event.commits) }}') + 2))" >> $GITHUB_ENV | ||
echo "branch=${{ github.ref_name }}" >> $GITHUB_ENV | ||
fi | ||
if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
echo "depth=$((${{ github.event.pull_request.commits }}+2))" >> $GITHUB_ENV | ||
echo "branch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV | ||
fi | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{env.branch}} | ||
fetch-depth: ${{env.depth}} | ||
- uses: trufflesecurity/trufflehog@main | ||
with: | ||
extra_args: --results=verified,unknown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
default_language_version: | ||
python: python3.9 | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v5.0.0" | ||
hooks: | ||
- id: no-commit-to-branch | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: 'v0.8.0' | ||
hooks: | ||
- id: ruff | ||
args: [ "--fix" ] | ||
- id: ruff-format | ||
- repo: https://github.com/trufflesecurity/trufflehog.git | ||
rev: "v3.84.2" | ||
hooks: | ||
- id: trufflehog | ||
name: TruffleHog | ||
description: Detect secrets in your data. | ||
entry: bash -c 'trufflehog git file://. --since-commit HEAD --only-verified --fail --no-update' | ||
language: system | ||
stages: ["pre-commit", "pre-push"] |