chore(ci): 更新CI工作流配置以集成MegaLinter和SARIF报告

- 在.gitleaks.toml中添加测试凭证白名单注释说明
- 为MegaLinter步骤添加代码质量检查和安全扫描功能
- 配置FAIL_ON_ERROR环境变量在main分支上失败时停止
- 添加SARIF报告上传步骤到GitHub安全中心
- 更新TruffleHog扫描步骤的中文注释说明
This commit is contained in:
GeWuYou 2026-02-02 12:20:56 +08:00
parent b4b26517ad
commit 5c8de84256
2 changed files with 10 additions and 0 deletions

View File

@ -23,11 +23,19 @@ jobs:
with:
fetch-depth: 0
# MegaLinter扫描步骤
# 执行代码质量检查和安全扫描生成SARIF格式报告
- name: MegaLinter
uses: oxsecurity/megalinter@v9.3.0
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FAIL_ON_ERROR: ${{ github.ref == 'refs/heads/main' }}
# 上传SARIF格式的安全和代码质量问题报告到GitHub安全中心
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: megalinter-reports/sarif
# TruffleHog OSS 扫描步骤
# 使用 TruffleHog 工具扫描代码库中的敏感信息泄露如API密钥、密码等
# 该步骤会比较基础分支和当前提交之间的差异,检测新增内容中是否包含敏感数据

View File

@ -1,3 +1,5 @@
# Allowlist for fake/test/demo secrets only
# DO NOT add real credentials here
[allowlist]
description = "Ignore test/demo secrets"