|
1 | | -name: "CodeQL Analysis" |
| 1 | +name: "CodeQL Security Scan" |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [ "main", "feature/karpathy-lab-init" ] |
| 5 | + branches: |
| 6 | + - main |
6 | 7 | pull_request: |
7 | | - branches: [ "main" ] |
| 8 | + branches: |
| 9 | + - main |
8 | 10 | 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 |
17 | 12 |
|
18 | 13 | jobs: |
19 | 14 | analyze: |
20 | | - name: Analyze |
| 15 | + name: Analyze code with CodeQL |
21 | 16 | runs-on: ubuntu-latest |
22 | | - timeout-minutes: 30 |
| 17 | + |
| 18 | + permissions: |
| 19 | + actions: read |
| 20 | + contents: read |
| 21 | + security-events: write |
23 | 22 |
|
24 | 23 | strategy: |
25 | 24 | fail-fast: false |
26 | 25 | matrix: |
27 | | - language: [ 'python' ] |
| 26 | + language: ["python"] |
28 | 27 |
|
29 | 28 | steps: |
30 | 29 | - name: Checkout repository |
31 | 30 | uses: actions/checkout@v4 |
32 | 31 | 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 |
33 | 42 |
|
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