Repository navigation
46 lines (43 loc) · 1.53 KB
/
Copy pathcodeql.yml
File metadata and controls
46 lines (43 loc) · 1.53 KB
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
name: codeql
on:
workflow_call:
inputs:
languages:
description: >-
JSON list of what to analyze, each {"language", "build-mode"} in CodeQL's own names
("javascript-typescript", "java-kotlin", ...; "none" or "autobuild")
type: string
required: true
upload:
description: Whether the results become code scanning alerts of the repository ("always", "failure-only" or "never")
type: string
default: always
permissions:
contents: read
jobs:
analyze:
name: codeql (${{ matrix.language }})
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(inputs.languages) }}
runs-on: ubuntu-latest
permissions:
# code scanning alerts are security events
security-events: write
# CodeQL reads the workflow run it is part of, which a private repository does not let it do otherwise
actions: read
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
languages: ${{ matrix.language }}
# with "autobuild", the analysis below runs the build itself
build-mode: ${{ matrix.build-mode }}
- uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
category: /language:${{ matrix.language }}
upload: ${{ inputs.upload }}