This commit is contained in:
haibo.chen
2025-10-15 14:18:47 +08:00
parent 156f07644d
commit 1178b974a1
3 changed files with 79 additions and 0 deletions

52
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: "CodeQL"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
# 每周一凌晨2点运行
- cron: '0 2 * * 1'
jobs:
analyze:
name: Analyze Go Code
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true
# 初始化 CodeQL
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
# 自动构建
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# 执行 CodeQL 分析
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"