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"