From 108a3143537cb19c5a1f449f006f3877c9c42236 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 9 Jun 2025 15:45:45 -0700 Subject: [PATCH] Add option to set cli-version --- action.yml | 6 +++++- src/windows/Install-DashcamCLI.ps1 | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 2aa2408..b4c0415 100644 --- a/action.yml +++ b/action.yml @@ -6,6 +6,10 @@ inputs: version: description: "The version of Dashcam to install. See releases here: https://github.com/replayableio/replayable/releases" required: true + cli-version: + description: "The version of Dashcam cli to install. see: https://www.npmjs.com/package/dashcam?activeTab=versions" + required: false + default: "latest" node-version: description: "The version of Node.js to install. Must match the required version for cli see: https://github.com/replayableio/cli/blob/main/package.json" required: true @@ -44,7 +48,7 @@ runs: Write-Host "Installing Dashcam CLI on ${{ runner.os }}" $env:PATH = "$env:GITHUB_ACTION_PATH\src\windows;${{ inputs.node-directory }};${{ inputs.node-prefix }};$env:PATH" - Install-DashcamCLI.ps1 + Install-DashcamCLI.ps1 -Version ${{ inputs.cli-version }} Add-Content -Path $env:GITHUB_ENV -Encoding utf8 -Value "DASHCAM_NODE_DIR=${{ inputs.node-directory }}" - name: Install Dashcam GUI (macOS) diff --git a/src/windows/Install-DashcamCLI.ps1 b/src/windows/Install-DashcamCLI.ps1 index 7cf2f76..5397252 100644 --- a/src/windows/Install-DashcamCLI.ps1 +++ b/src/windows/Install-DashcamCLI.ps1 @@ -1,8 +1,15 @@ +param ( + [Parameter(Mandatory = $true)] + [string]$Version +) + $global:ErrorActionPreference = "Stop" $global:ProgressPreference = "SilentlyContinue" Set-StrictMode -Version Latest -& npm install --location=global dashcam +Write-Host "Installing Dashcam CLI $Version..." + +& npm install --location=global dashcam@$Version Write-Host "Verifying Dashcam CLI Install..." & dashcam --help