-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (53 loc) · 1.58 KB
/
codeql-analysis-template.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
#SPDX-FileCopyrightText: 2017-2024 Enedis
#SPDX-License-Identifier: Apache-2.0
name: "CodeQL template"
on:
workflow_call:
inputs:
project-dir:
type: string
default: ""
required: false
description: "sourcecode root directory"
language:
type: string
required: true
description: "Release if true"
build-mode:
type: string
required: false
default: autobuild
description: "The build mode that will be used to analyze the language"
jobs:
codeql-analyze:
runs-on: ubuntu-latest
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: "maven"
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ inputs.language }}
build-mode: ${{ inputs.build-mode }}
source-root: ${{ inputs.project-dir }}
- if: inputs.build-mode == 'autobuild'
name: Auto build
uses: github/codeql-action/autobuild@v3
with:
working-directory: ${{ inputs.project-dir }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{inputs.language}}"