forked from jaegertracing/jaeger
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (56 loc) · 2.06 KB
/
Copy pathcodeql.yml
File metadata and controls
69 lines (56 loc) · 2.06 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
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright (c) 2026 The Jaeger Authors.
# SPDX-License-Identifier: Apache-2.0
name: "CodeQL"
on:
workflow_call:
schedule:
- cron: '31 6 * * 1'
# See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
codeql-analyze:
# Skip merge_group to avoid duplicate runs (code already scanned on pull_request)
# See https://github.com/github/codeql-action/issues/1537
if: ${{ github.event_name != 'merge_group' }}
name: CodeQL Analyze
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
strategy:
fail-fast: false
matrix:
language: [ 'go', 'python' ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: true
- name: Setup Go
if: matrix.language == 'go'
uses: ./.github/actions/setup-go
with:
go-version: 1.26.x
- name: Initialize CodeQL
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
with:
languages: ${{ matrix.language }}
# Use Autobuild for Python (it works fine for interpreted languages)
- name: Autobuild (Python)
if: matrix.language == 'python'
uses: github/codeql-action/autobuild@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
# Explicit build for Go - required for CodeQL to analyze compiled code
- name: Build Go code
if: matrix.language == 'go'
run: |
# Build all Go binaries to ensure CodeQL can analyze them
go build -v ./...
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
with:
category: ".github/workflows/codeql.yml:codeql-analyze/language:${{ matrix.language }}"