Repository navigation
85 lines (82 loc) · 3.59 KB
/
Copy pathcodeql.yml
File metadata and controls
85 lines (82 loc) · 3.59 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
83
84
85
# SPDX-FileCopyrightText: 2026 Yangtse Su
# SPDX-License-Identifier: GPL-3.0-or-later
# CodeQL static analysis — Kotlin/Java. Runs on pushes to main, pull requests,
# and a weekly schedule; finds security vulnerabilities in the app code (the
# repo has no backend, so scanning covers the Android module).
#
# Paused 2026-09-10 → 2026-09-29 (b91d6f4 … the commit that re-enabled it):
# CodeQL's Kotlin extractor rejected the then-current Kotlin with
# KotlinVersionTooRecentError: CodeQL currently supports versions below 2.4.20
# and the repo tracks latest-stable Kotlin (no-pin policy, AGENTS.md), so
# pinning Kotlin back to satisfy CodeQL was off the table. The upstream fix
# (github/codeql#22404, "Kotlin: support 2.4.20") merged 2026-09-08 — one day
# past the 2.27.0 release cut — hence 2.27.1 was the first stable bundle to
# carry it, published 2026-09-22. The `@v4` actions below now resolve to a
# bundle that includes it (v4.38.2 → codeql-bundle-v2.27.1). The A/B evidence
# (same commit, same workflow body, only the bundle differed: stable 2.27.0
# failed, the nightly passed) is recorded in issue #7.
#
# If Kotlin ever advances past the extractor again, pause this workflow the same
# way (`if: false` + `workflow_dispatch`) rather than pinning Kotlin back.
# Tracking issue: https://github.com/YangtseSu/HearWrite/issues/7
#
# Two step details are load-bearing, both settled while the workflow was paused:
# - `packages: platform-tools` on the SDK step — the standalone `tools`
# package no longer exists, so the action's `tools platform-tools` default
# would fail the job before any repo code ran, looking like a CodeQL
# problem (same narrowing as build.yml / release.yml).
# - `@v4` on the three codeql-action steps — v3 is deprecated in December
# 2026. Renovate watches these pins (github-actions manager in
# renovate.json); digest pinning is deliberately off — the repo tracks
# latest stable, not immutable SHAs.
#
# Secret scanning + push protection are enabled repo-wide (independent of
# CodeQL) and cover the credential-leak class that matters most here.
name: "CodeQL"
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "21 4 * * 1" # weekly: Monday 04:21 UTC
jobs:
analyze:
name: Analyze
# Same base image as CI (build.yml pins 26.04: the archive's `reuse`).
runs-on: ubuntu-26.04
permissions:
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
language: ["java-kotlin"]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
- name: Set up JDK 27
uses: actions/setup-java@v6
with:
distribution: temurin
java-version: "27"
# `packages: platform-tools` is required, not cosmetic: the action's
# default is `tools platform-tools`, but Google retired the standalone
# `tools` package (folded into `cmdline-tools`), so `sdkmanager tools`
# exits 1 with "Failed to find package 'tools'" and fails the job before
# any repo code runs. Same narrowing as build.yml / release.yml.
- name: Set up Android SDK
uses: android-actions/setup-android@v4
with:
packages: platform-tools
- name: Autobuild
uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"