Skip to content

Commit 8a81c5b

Browse files
committed
Add a feature flag to turn this off for newer versions of codeql
1 parent 028bacb commit 8a81c5b

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

.github/workflows/python312-windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
version: default
3131

3232
- name: Initialize CodeQL
33-
uses: ./../init
33+
uses: ./../action/init
3434
with:
3535
tools: latest
3636
languages: python

lib/init-action.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init.js

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/init-action.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ async function run() {
283283
logger,
284284
);
285285

286-
await checkInstallPython311(config.languages);
286+
await checkInstallPython311(config.languages, codeql);
287287

288288
if (
289289
config.languages.includes(Language.python) &&

src/init.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,15 @@ function processError(e: any): Error {
186186
* If we are running python 3.12+ on windows, we need to switch to python 3.11.
187187
* This check happens in a powershell script.
188188
*/
189-
export async function checkInstallPython311(languages: Language[]) {
190-
if (languages.includes(Language.python) && process.platform === "win32") {
189+
export async function checkInstallPython311(
190+
languages: Language[],
191+
codeql: CodeQL,
192+
) {
193+
if (
194+
languages.includes(Language.python) &&
195+
process.platform === "win32" &&
196+
(await codeql.getVersion()).features?.supportsPython312
197+
) {
191198
const script = path.resolve(
192199
__dirname,
193200
"../python-setup",

0 commit comments

Comments
 (0)