Skip to content

Commit 2f0c512

Browse files
committed
ci(security): add clean CodeQL workflow v4
1 parent 2aded84 commit 2f0c512

File tree

1 file changed

+27
-43
lines changed

1 file changed

+27
-43
lines changed

.github/workflows/codeql.yml

Lines changed: 27 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,46 @@
1-
name: "CodeQL Analysis"
1+
name: "CodeQL Security Scan"
22

33
on:
44
push:
5-
branches: [ "main", "feature/karpathy-lab-init" ]
5+
branches:
6+
- main
67
pull_request:
7-
branches: [ "main" ]
8+
branches:
9+
- main
810
schedule:
9-
# Run CodeQL every Monday at 9:00 AM UTC
10-
- cron: '0 9 * * 1'
11-
workflow_dispatch:
12-
13-
permissions:
14-
actions: read
15-
contents: read
16-
security-events: write
11+
- cron: "0 3 * * 0" # Opcional: escaneo semanal cada domingo a las 03:00
1712

1813
jobs:
1914
analyze:
20-
name: Analyze
15+
name: Analyze code with CodeQL
2116
runs-on: ubuntu-latest
22-
timeout-minutes: 30
17+
18+
permissions:
19+
actions: read
20+
contents: read
21+
security-events: write
2322

2423
strategy:
2524
fail-fast: false
2625
matrix:
27-
language: [ 'python' ]
26+
language: ["python"]
2827

2928
steps:
3029
- name: Checkout repository
3130
uses: actions/checkout@v4
3231
uses: actions/checkout@v6
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@v4
37+
with:
38+
languages: ${{ matrix.language }}
39+
40+
- name: Autobuild
41+
uses: github/codeql-action/autobuild@v4
3342

34-
- name: Initialize CodeQL
35-
uses: github/codeql-action/init@v4
36-
with:
37-
languages: ${{ matrix.language }}
38-
queries: security-extended,security-and-quality
39-
config: |
40-
paths-ignore:
41-
- '**/test/**'
42-
- '**/tests/**'
43-
- '**/*_test.py'
44-
- '**/test_*.py'
45-
46-
- name: Autobuild
47-
uses: github/codeql-action/autobuild@v4
48-
49-
- name: Perform CodeQL Analysis
50-
uses: github/codeql-action/analyze@v4
51-
with:
52-
category: "/language:${{matrix.language}}"
53-
upload: true
54-
output: sarif-results
55-
56-
- name: Upload CodeQL results
57-
uses: actions/upload-artifact@v4
58-
if: always()
59-
with:
60-
name: codeql-results
61-
path: sarif-results
62-
retention-days: 30
43+
- name: Perform CodeQL Analysis
44+
uses: github/codeql-action/analyze@v4
45+
with:
46+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)