-
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (57 loc) · 2.11 KB
/
Copy pathgithub-codeql-analysis.yml
File metadata and controls
57 lines (57 loc) · 2.11 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
47
48
49
50
51
52
53
54
55
56
57
---
name: GitHub CodeQL Analysis
on:
workflow_call:
inputs:
language:
required: false
type: string
description: The language to analyze (JSON array)
default: >
["python"]
go-version:
required: false
type: string
description: Go version to use
default: stable
runs-on:
required: false
type: string
description: Runner to use
default: ubuntu-slim
permissions:
security-events: write # required for all workflows
actions: read # only required for workflows in private repositories
contents: read # only required for workflows in private repositories
jobs:
codeql-analysis:
runs-on: ${{ inputs.runs-on }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
strategy:
fail-fast: false
matrix:
language: ${{ fromJSON(inputs.language) }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
persist-credentials: false
- name: Set up Go
if: matrix.language == 'go'
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ inputs.go-version }}
cache: true
- name: Initialize CodeQL
uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
with:
languages: ${{ matrix.language }} # { actions, c-cpp, csharp, go, java-kotlin, javascript-typescript, python, ruby, swift }
build-mode: ${{ matrix.language == 'actions' && 'none' || '' }}
- name: Autobuild # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
if: matrix.language != 'actions'
uses: github/codeql-action/autobuild@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
with:
category: /language:${{ matrix.language }}