name: "CodeQL MaaCore and MaaWpfGui Analysis" on: pull_request: branches: ["dev"] paths: - "3rdparty/include/**" - "include/**" - "src/**" - "cmake/**" - "CMakeLists.txt" - ".github/workflows/codeql-core.yml" - "!**/*.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 with: category: "/language:multi-manual" - 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 }}