mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 09:50:40 +08:00
ci: split codeql (#13812)
* perf: codeql core * perf: standardize caching for codeqlcore * fix: correct cache keys * perf: add codeql-js for website and workflows * fix: typo * fix: use bash instead of pwsh in ubuntu
This commit is contained in:
72
.github/workflows/codeql-js.yml
vendored
Normal file
72
.github/workflows/codeql-js.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
name: "CodeQL Website and Workflows Analysis"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: ["dev"]
|
||||
paths:
|
||||
- "website/**"
|
||||
- ".github/workflows/*.yml"
|
||||
- ".github/*.yml"
|
||||
- "!**/*.md"
|
||||
schedule:
|
||||
- cron: "00 12 * * *" # Runs daily at 12:00 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
jobs:
|
||||
analyze-website:
|
||||
name: Analyze Website (JavaScript/TypeScript)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
- name: Setup CodeQL for JavaScript/TypeScript
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: javascript-typescript
|
||||
build-mode: none
|
||||
|
||||
- name: Run CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:multi-none"
|
||||
|
||||
- name: Delete old caches
|
||||
shell: bash
|
||||
run: |
|
||||
oldCaches=$(gh cache list --key codeql --order asc --json key | jq -r '.[] | .key' | head -n -1)
|
||||
for cache in $oldCaches; do
|
||||
if [ -n "$cache" ]; then
|
||||
echo "Deleting cache: $cache"
|
||||
gh cache delete "$cache" --confirm
|
||||
fi
|
||||
done
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
analyze-workflows:
|
||||
name: Analyze GitHub Workflows
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
- name: Setup CodeQL for GitHub Actions
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: actions
|
||||
build-mode: none
|
||||
|
||||
- name: Run CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:multi-none"
|
||||
Reference in New Issue
Block a user