-
Notifications
You must be signed in to change notification settings - Fork 401
82 lines (71 loc) · 2.06 KB
/
codeql.yml
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
name: "CodeQL"
on:
workflow_call:
workflow_dispatch:
push:
branches:
- master
- release/**
pull_request:
types: [opened, synchronize]
branches:
- master
- release/**
concurrency:
group: codeql-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ java ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
config-file: ./.github/codeql/codeql-config.yml
packs: "codeql/${{ matrix.language }}-queries:AlertSuppression.ql"
- name: Autobuild
uses: github/codeql-action/autobuild@v3
if: ${{ matrix.language == 'java' }}
- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
upload: false
output: sarif-results
- name: Upload SARIF
id: upload
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/${{ matrix.language }}.sarif
wait-for-processing: true
# optional: for debugging the uploaded sarif
- name: Upload loc as a Build Artifact
uses: actions/upload-artifact@v4
with:
name: sarif-results-${{ matrix.language }}
path: sarif-results
retention-days: 1
- name: Dismiss alerts
if: github.ref == 'refs/heads/master'
uses: advanced-security/dismiss-alerts@v1
with:
sarif-id: ${{ steps.upload.outputs.sarif-id }}
sarif-file: sarif-results/${{ matrix.language }}.sarif
env:
GITHUB_TOKEN: ${{ github.token }}