Skip to content

Commit 3840508

Browse files
Add rule .env.* to .gitignore (#80)
* Add rule .env.* to .gitignore * Add pre-commit workflow and config * Exclude workflow
1 parent b07bad9 commit 3840508

4 files changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Pre-commit Checks
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
pre-commit:
13+
name: Run pre-commit hooks
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
with:
20+
persist-credentials: false
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
24+
with:
25+
python-version: '3.12'
26+
cache: 'pip'
27+
28+
- name: Install pre-commit
29+
run: pip install pre-commit
30+
31+
- name: Run pre-commit
32+
run: pre-commit run --all-files --show-diff-on-failure

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ celerybeat.pid
179179
*.sage.py
180180

181181
# Environments
182+
# Local environment files may contain credentials
182183
.env
184+
.env.*
185+
!.env.example
183186
.venv
184187
env/
185188
venv/

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
3+
rev: v1.25.2
4+
hooks:
5+
- id: zizmor
6+
exclude: ^\.github/workflows/run-samples\.yml$
7+
8+
- repo: https://github.com/gitleaks/gitleaks
9+
rev: v8.30.1
10+
hooks:
11+
- id: gitleaks

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-r requirements-runtime.txt
2+
pre-commit
23
pytest
34
pytest-xdist
45
pytest-timeout

0 commit comments

Comments
 (0)