Skip to content

Commit 8c9ae53

Browse files
Add Pre-commit, gitleaks,codeql (#172)
* Add security workflows: pre-commit hooks, dependency review, CodeQL for Python * Add security workflows: pre-commit hooks, dependency review
1 parent 9401e9b commit 8c9ae53

2 files changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Dependency Review - blocks PRs that introduce known-vulnerable dependencies
2+
name: Dependency Review
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
jobs:
13+
dependency-review:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Dependency Review
20+
uses: actions/dependency-review-action@v4
21+
with:
22+
fail-on-severity: high
23+
comment-summary-in-pr: always
24+
deny-licenses: GPL-3.0-only, AGPL-3.0-only

.pre-commit-config.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Pre-commit hooks for Agent365-python
2+
# Install: pip install pre-commit && pre-commit install
3+
# Run manually: pre-commit run --all-files
4+
5+
repos:
6+
# Gitleaks - detect secrets in code
7+
- repo: https://github.com/gitleaks/gitleaks
8+
rev: v8.18.4
9+
hooks:
10+
- id: gitleaks
11+
12+
# Whitespace fixes
13+
- repo: https://github.com/pre-commit/pre-commit-hooks
14+
rev: v4.6.0
15+
hooks:
16+
- id: trailing-whitespace
17+
args: [--markdown-linebreak-ext=md]
18+
- id: end-of-file-fixer
19+
- id: mixed-line-ending
20+
args: [--fix=lf]
21+
- id: check-merge-conflict
22+
- id: check-yaml
23+
args: [--allow-multiple-documents]
24+
- id: check-json
25+
- id: check-toml
26+
- id: check-ast
27+
28+
# Python specific - using Ruff (matches CI settings)
29+
- repo: https://github.com/astral-sh/ruff-pre-commit
30+
rev: v0.4.4
31+
hooks:
32+
- id: ruff
33+
args: [--fix, --line-length=100]
34+
- id: ruff-format
35+
args: [--line-length=100]

0 commit comments

Comments
 (0)