Skip to content

Commit

Permalink
Add a feature flag to turn this off for newer versions of codeql
Browse files Browse the repository at this point in the history
  • Loading branch information
aeisenberg committed Oct 6, 2023
1 parent 028bacb commit 669c610
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python312-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
version: default

- name: Initialize CodeQL
uses: ./../init
uses: ./../action/init
with:
tools: latest
languages: python
Expand Down
2 changes: 1 addition & 1 deletion lib/init-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init-action.js.map

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions lib/init.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/init-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ async function run() {
logger,
);

await checkInstallPython311(config.languages);
await checkInstallPython311(config.languages, codeql);

if (
config.languages.includes(Language.python) &&
Expand Down
11 changes: 9 additions & 2 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,15 @@ function processError(e: any): Error {
* If we are running python 3.12+ on windows, we need to switch to python 3.11.
* This check happens in a powershell script.
*/
export async function checkInstallPython311(languages: Language[]) {
if (languages.includes(Language.python) && process.platform === "win32") {
export async function checkInstallPython311(
languages: Language[],
codeql: CodeQL,
) {
if (
languages.includes(Language.python) &&
process.platform === "win32" &&
!(await codeql.getVersion()).features?.supportsPython312
) {
const script = path.resolve(
__dirname,
"../python-setup",
Expand Down

0 comments on commit 669c610

Please sign in to comment.