Skip to content

Commit cf1d8df

Browse files
Add security workflows: pre-commit hooks, dependency review (#239)
1 parent 16e1941 commit cf1d8df

2 files changed

Lines changed: 68 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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Pre-commit hooks for Agent365-devTools
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-xml
26+
27+
# .NET specific - format check
28+
- repo: local
29+
hooks:
30+
- id: dotnet-format
31+
name: dotnet format
32+
entry: dotnet format src/Microsoft.Agents.A365.DevTools.Cli.sln --verify-no-changes --verbosity diagnostic
33+
language: system
34+
types: [c#]
35+
pass_filenames: false
36+
37+
# Python specific (for autoTriage scripts) - using Ruff
38+
- repo: https://github.com/astral-sh/ruff-pre-commit
39+
rev: v0.4.4
40+
hooks:
41+
- id: ruff
42+
args: [--fix, --line-length=100]
43+
- id: ruff-format
44+
args: [--line-length=100]

0 commit comments

Comments
 (0)