-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.53 KB
/
dependency-check.yml
File metadata and controls
61 lines (51 loc) · 1.53 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
name: Dependency Check
on:
schedule:
# Run every Monday at 9 AM UTC
- cron: '0 9 * * 1'
pull_request:
branches: [ main ]
paths:
- 'requirements.txt'
- '.github/workflows/dependency-check.yml'
workflow_dispatch:
jobs:
check-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Create virtual environment
run: uv venv
- name: Install dependencies
run: |
source .venv/bin/activate
uv pip install -r requirements.txt
- name: Check for outdated packages
run: |
source .venv/bin/activate
uv pip list --outdated
- name: Security check with pip-audit
run: |
source .venv/bin/activate
uv pip install pip-audit
pip-audit || true
- name: Create issue if vulnerabilities found
if: failure()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Security vulnerabilities found in dependencies',
body: 'The dependency check workflow found security vulnerabilities. Please review the workflow logs and update dependencies as needed.',
labels: ['security', 'dependencies']
})