-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (77 loc) · 2.62 KB
/
Copy pathsecurity.yml
File metadata and controls
97 lines (77 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Security
on:
schedule:
- cron: '0 2 * * 1' # Every Monday at 2 AM
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install safety bandit
- name: Run safety check
run: |
safety check --json --output safety-report.json || true
- name: Run bandit security scan
run: |
bandit -r agent/ -f json -o bandit-report.json || true
- name: Upload security reports
uses: actions/upload-artifact@v3
with:
name: security-reports
path: |
safety-report.json
bandit-report.json
retention-days: 30
dependency-update:
name: Dependency Update Check
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install pip-tools
run: |
python -m pip install --upgrade pip
pip install pip-tools
- name: Check for outdated dependencies
run: |
pip list --outdated --format=json > outdated-deps.json
- name: Create issue for outdated dependencies
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const outdated = JSON.parse(fs.readFileSync('outdated-deps.json', 'utf8'));
if (outdated.length > 0) {
const body = `## Outdated Dependencies Found
The following dependencies have newer versions available:
${outdated.map(dep => `- **${dep.name}**: ${dep.version} → ${dep.latest_version}`).join('\n')}
Please review and update these dependencies when appropriate.
---
*This issue was automatically generated by GitHub Actions.*`;
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: '🔍 Outdated Dependencies Detected',
body: body,
labels: ['dependencies', 'automated']
});
}