mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
name: CodeQL Code Analysis
|
|
|
|
on:
|
|
pull_request:
|
|
branches: ["dev"]
|
|
paths:
|
|
- ".github/workflows/codeql-core.yml"
|
|
- "3rdparty/include/**"
|
|
- "cmake/**"
|
|
- "CMakeLists.txt"
|
|
- "include/**"
|
|
- "src/**"
|
|
- "!**/*.md"
|
|
- "!**/*.xaml"
|
|
schedule:
|
|
- cron: "45 11 * * *" # Runs daily at 11:45 UTC
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
actions: write
|
|
contents: read
|
|
packages: read
|
|
security-events: write
|
|
|
|
jobs:
|
|
analyze-manual:
|
|
name: Analyze MaaCore and MaaWpfGui
|
|
if: github.repository_owner == 'MaaAssistantArknights'
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
show-progress: false
|
|
|
|
- name: Setup CodeQL
|
|
uses: github/codeql-action/init@v4
|
|
with:
|
|
languages: c-cpp,csharp
|
|
build-mode: manual
|
|
|
|
- name: Run CodeQL
|
|
uses: github/codeql-action/analyze@v4
|
|
|
|
- name: Delete old caches
|
|
shell: pwsh
|
|
run: |
|
|
$oldCaches = gh cache list --key codeql --order asc --json key | ConvertFrom-Json | Select-Object -SkipLast 1
|
|
foreach ($cache in $oldCaches) {
|
|
if ($cache.key) {
|
|
Write-Host "Deleting cache: $($cache.key)"
|
|
gh cache delete $cache.key
|
|
}
|
|
}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|