Skip to content

Commit c6483ae

Browse files
chore: add security scans
1 parent 591654f commit c6483ae

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,21 @@ on:
1313
branches:
1414
- main
1515

16+
workflow_dispatch:
17+
inputs:
18+
run_security_scans:
19+
description: 'Run FOSSA and CODEQL scans'
20+
required: false
21+
default: 'false'
22+
1623
jobs:
1724
commit-lint:
1825
if: ${{ github.event_name == 'pull_request' }}
1926
uses: ./.github/workflows/commitlint.yml
2027

2128
lint:
2229
uses: ./.github/workflows/lint.yml
30+
31+
security-scans:
32+
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.run_security_scans =='true')
33+
uses: ./.github/workflows/security-scans.yml
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Security Stages
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
codeql:
8+
name: CodeQL Analysis
9+
runs-on: ubuntu-latest
10+
permissions:
11+
security-events: write
12+
contents: read
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Initialize CodeQL
19+
uses: github/codeql-action/init@v3
20+
with:
21+
languages: python
22+
23+
- name: Setup uv
24+
uses: astral-sh/setup-uv@v5
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.10'
30+
31+
- name: Install dependencies
32+
run: uv sync --all-extras
33+
34+
- name: Run CodeQL Analysis
35+
uses: github/codeql-action/analyze@v3
36+
37+
38+
fossa:
39+
name: FOSSA Scan
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
45+
- name: Run FOSSA scan
46+
uses: fossas/fossa-action@main
47+
with:
48+
api-key: ${{ secrets.FOSSA_API_KEY }}
49+
debug: true
50+
51+
- name: Upload FOSSA artifact
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: fossa.debug.json.gz
55+
path: ./fossa.debug.json.gz
56+

0 commit comments

Comments
 (0)