Skip to content
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
19 changes: 19 additions & 0 deletions .github/workflows/gitleaks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: gitleaks
on:
pull_request:
push:
workflow_dispatch:
schedule:
- cron: "0 4 * * *" # run once a day at 4 AM
jobs:
scan:
name: gitleaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.0
hooks:
- id: gitleaks
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.PHONY: precommit_setup precommit_install precommit_update precommit_run precommit_staged
# Install pre-commit tooling
precommit_setup:
@echo "Setting up pre-commit..."
pip install pre-commit

# Install the hooks
precommit_install: precommit_setup
@echo "Installing pre-commit hooks..."
pre-commit install

# Update the hooks to the latest versions
precommit_update: precommit_setup
@echo "Updating pre-commit hooks..."
pre-commit autoupdate

# Run all hooks against all the files
precommit_run:
@echo "Running pre-commit hooks..."
pre-commit run --all-files

# Run all hooks against staged files
precommit_staged:
@echo "Running pre-commit hooks against staged files..."
pre-commit run --files $$(git diff --name-only --cached)

# Your other Makefile targets
# ...
setup: precommit_setup precommit_update precommit_install