Skip to content

Commit 515e261

Browse files
authored
chore: fix install python ci step (#31204)
1 parent 004b857 commit 515e261

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/ci.generate.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,16 @@ function withCondition(
299299
step: Record<string, unknown>,
300300
condition: string,
301301
): Record<string, unknown> {
302+
function maybeParens(condition: string) {
303+
if (condition.includes("&&") || condition.includes("||")) {
304+
return `(${condition})`;
305+
} else {
306+
return condition;
307+
}
308+
}
302309
return {
303310
...step,
304-
if: "if" in step ? `${condition} && (${step.if})` : condition,
311+
if: "if" in step ? `${maybeParens(condition)} && (${step.if})` : condition,
305312
};
306313
}
307314

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ jobs:
189189
python-version: 3.11
190190
if: '!(matrix.skip) && (matrix.os != ''linux'' || matrix.arch != ''aarch64'')'
191191
- name: Remove unused versions of Python
192-
if: '!(matrix.skip) && (matrix.os != ''linux'' || matrix.arch != ''aarch64'' && (matrix.os == ''windows''))'
192+
if: '!(matrix.skip) && ((matrix.os != ''linux'' || matrix.arch != ''aarch64'') && (matrix.os == ''windows''))'
193193
shell: pwsh
194194
run: |-
195195
$env:PATH -split ";" |

0 commit comments

Comments
 (0)