-
Notifications
You must be signed in to change notification settings - Fork 15
82 lines (70 loc) · 2.66 KB
/
Copy pathcodeql.yml
File metadata and controls
82 lines (70 loc) · 2.66 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: 'CodeQL'
# SMI-2508: Advanced setup replaces default setup (disabled via API).
# Covers both javascript-typescript and actions languages.
on:
push:
branches: [main]
paths-ignore:
- '.claude/development/**'
- '.claude/templates/**'
- '**/*.md'
- '!.gitmodules'
- 'LICENSE'
- '.github/ISSUE_TEMPLATE/**'
- '.github/CODEOWNERS'
pull_request:
branches: [main]
paths-ignore:
- '.claude/development/**'
- '.claude/templates/**'
- '**/*.md'
- '!.gitmodules'
- 'LICENSE'
- '.github/ISSUE_TEMPLATE/**'
- '.github/CODEOWNERS'
schedule:
- cron: '0 2 * * 1' # Monday at 2 AM UTC
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: read
contents: read
security-events: write
issues: write
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: ['javascript-typescript', 'actions']
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Initialize CodeQL
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
with:
category: '/language:${{ matrix.language }}'
# SMI-3335: Alert on scheduled workflow failure
- name: Alert on failure
if: failure() && github.event_name == 'schedule'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
EXISTING=$(gh issue list --repo "${{ github.repository }}" --label "ci-alert" --search "CodeQL failed" --state open --json number --jq '.[0].number // empty')
if [ -n "$EXISTING" ]; then
gh issue comment "$EXISTING" --repo "${{ github.repository }}" --body "Still failing (${{ matrix.language }}): ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
else
gh issue create --repo "${{ github.repository }}" --title "CI: CodeQL failed ($(date -u +%Y-%m-%d))" --label "ci-alert" --body "**Workflow**: CodeQL (${{ matrix.language }})
**Run**: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
**Branch**: ${{ github.ref_name }}
This issue was auto-created by SMI-3335. Close when resolved."
fi