-
Notifications
You must be signed in to change notification settings - Fork 243
61 lines (51 loc) · 2.02 KB
/
Copy pathcodeql-analysis.yml
File metadata and controls
61 lines (51 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright (c) 2026 Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: MIT
name: CodeQL Security Analysis
on:
schedule:
# Weekly scan: Sundays at 4 AM UTC
- cron: '0 4 * * 0'
workflow_call:
permissions:
contents: read
jobs:
analyze:
name: CodeQL Analysis
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write # Required for SARIF upload to Security tab
actions: read
strategy:
fail-fast: false
matrix:
# Repository contains GitHub Actions workflows, Python, and JavaScript/TypeScript (VS Code extension source)
# CodeQL 'actions' scans workflows, 'python' scans scripts, and 'javascript-typescript' covers both JS and TS
# PowerShell and shell scripts are not CodeQL-supported (covered by PSScriptAnalyzer and shellcheck)
language: [ 'actions', 'python', 'javascript-typescript' ]
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@ce729e4d353d580e6cacd6a8cf2921b72e5e310a # v3.27.0
with:
languages: ${{ matrix.language }}
queries: security-extended,security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@ce729e4d353d580e6cacd6a8cf2921b72e5e310a # v3.27.0
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@ce729e4d353d580e6cacd6a8cf2921b72e5e310a # v3.27.0
with:
category: "/language:${{ matrix.language }}"
- name: Add job summary
if: always()
run: |
{
echo "## CodeQL Security Analysis Complete"
echo "**Language:** ${{ matrix.language }}"
echo "**Queries:** security-extended, security-and-quality"
echo ""
echo "📊 View results in the Security tab under Code Scanning"
} >> "$GITHUB_STEP_SUMMARY"