Skip to content

Commit b1fa87f

Browse files
committed
Add push/pull_request triggers to codeql-test-run-windows.yml
1 parent de18b40 commit b1fa87f

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

.github/workflows/codeql-test-run-windows.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ name: ⚙️ CodeQL - Run Unit Tests (Windows)
77
# Manual trigger only to conserve CI resources since Windows runners are slower.
88

99
on:
10+
pull_request:
11+
branches:
12+
- 'main'
13+
paths:
14+
- '.github/workflows/codeql-test-run-windows.yml'
15+
- 'qlt.conf.json'
16+
push:
17+
branches:
18+
- 'main'
19+
paths:
20+
- '.github/workflows/codeql-test-run-windows.yml'
21+
- 'qlt.conf.json'
1022
workflow_dispatch:
11-
inputs:
12-
codeql_version:
13-
description: 'CodeQL CLI version (e.g., "latest", "v2.19.0", or specific version)'
14-
required: false
15-
default: 'latest'
16-
type: string
1723

1824
permissions:
1925
contents: read
@@ -66,14 +72,18 @@ jobs:
6672
id: setup-codeql
6773
shell: pwsh
6874
run: |
69-
$version = "${{ github.event.inputs.codeql_version }}"
70-
if ($version -eq "" -or $version -eq "latest") {
71-
# Get the latest release version from GitHub API
72-
$releaseInfo = Invoke-RestMethod -Uri "https://api.github.com/repos/github/codeql-cli-binaries/releases/latest"
73-
$version = $releaseInfo.tag_name
75+
# Read CodeQL CLI version from qlt.conf.json
76+
$qltConfig = Get-Content "qlt.conf.json" | ConvertFrom-Json
77+
$cliVersion = $qltConfig.CodeQLCLI
78+
79+
# Ensure version has 'v' prefix for GitHub releases
80+
if (-not $cliVersion.StartsWith("v")) {
81+
$version = "v$cliVersion"
82+
} else {
83+
$version = $cliVersion
7484
}
7585
76-
Write-Host "Installing CodeQL CLI version: $version"
86+
Write-Host "Installing CodeQL CLI version: $version (from qlt.conf.json)"
7787
7888
# Determine download URL for Windows
7989
$downloadUrl = "https://github.com/github/codeql-cli-binaries/releases/download/$version/codeql-win64.zip"

0 commit comments

Comments
 (0)