Skip to content

Commit 5faf5ac

Browse files
committed
use nushell http command
instead of `curl` on unix or `irm ... iex` on windows because `curl` may not be available
1 parent 09178a8 commit 5faf5ac

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

action.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ runs:
292292
shell: nu {0}
293293
env:
294294
UV_NO_MODIFY_PATH: 1
295-
UV_VERSION: '0.8.9'
295+
UV_VERSION: '0.8.11'
296296
run: |-
297297
let action_path = $env.GITHUB_ACTION_PATH | path expand
298298
$env.UV_INSTALL_DIR = $action_path | path join 'bin'
@@ -303,10 +303,17 @@ runs:
303303
}
304304
305305
print $"\n(ansi purple)Installing uv version ($env.UV_VERSION)(ansi reset)"
306-
if ((sys host | get 'name') == 'Windows') {
307-
^powershell -ExecutionPolicy ByPass -c $"irm https://astral.sh/uv/($env.UV_VERSION)/install.ps1 | iex"
306+
let is_windows = (sys host | get 'name') == 'Windows'
307+
let uv_installer_url = if $is_windows {
308+
$"https://astral.sh/uv/($env.UV_VERSION)/install.ps1"
308309
} else {
309-
^curl -LsSf $"https://astral.sh/uv/($env.UV_VERSION)/install.sh" | sh
310+
$"https://astral.sh/uv/($env.UV_VERSION)/install.sh"
311+
}
312+
let installer = http get --raw --redirect-mode follow $uv_installer_url
313+
if $is_windows {
314+
^powershell -ExecutionPolicy ByPass $installer
315+
} else {
316+
$installer | ^sh
310317
}
311318
312319
let gh_action_debug = $env | get --optional 'ACTIONS_STEP_DEBUG'
@@ -317,21 +324,19 @@ runs:
317324
or ($gh_action_debug == 'true')
318325
)
319326
327+
print $"\n(ansi purple)Installing workflow dependencies(ansi reset)"
320328
mut uv_args = [sync --project $action_path --group action]
321329
if $verbosity {
322330
$uv_args = $uv_args | append '-v'
323331
}
324-
325-
print $"\n(ansi purple)Installing workflow dependencies(ansi reset)"
326332
^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args
327333
334+
print $"\n(ansi purple)Ensuring clang-format and clang-tidy ${{ inputs.version }} are present(ansi reset)"
328335
let cmd = [clang-tools -i ${{ inputs.version }} -b]
329336
$uv_args = [run --no-sync --project $action_path --directory (pwd)]
330337
if $verbosity {
331338
$uv_args = $uv_args | append '-v'
332339
}
333-
334-
print $"\n(ansi purple)Ensuring clang-format and clang-tidy ${{ inputs.version }} are present(ansi reset)"
335340
^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args ...$cmd
336341
337342
- name: Run cpp-linter

0 commit comments

Comments
 (0)