-
-
Notifications
You must be signed in to change notification settings - Fork 801
Upgrade to v1.1.0 #1784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to v1.1.0 #1784
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,11 +11,10 @@ env: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NODE_VERSION: 22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| checks: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| actions: read | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| statuses: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| context: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-22.04 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -49,128 +48,94 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: windows-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event.workflow_run.conclusion == 'success' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Create Check Run | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: create-check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/github-script@v7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| script: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const check = await github.rest.checks.create({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| owner: context.repo.owner, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repo: context.repo.repo, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: 'TestDriver.ai Run', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| head_sha: '${{ github.event.workflow_run.head_sha }}', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| status: 'in_progress' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return check.data.id; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: testdriverai/action@main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: testdriver | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FORCE_COLOR: "3" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key: ${{ secrets.DASHCAM_API }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prerun: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $headers = @{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Authorization = "token ${{ secrets.GITHUB_TOKEN }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $downloadFolder = "./download" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactFileName = "waveterm.exe" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactFilePath = "$downloadFolder/$artifactFileName" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Starting the artifact download process..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Create the download directory if it doesn't exist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (-not (Test-Path -Path $downloadFolder)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Creating download folder..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mkdir $downloadFolder | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Download folder already exists." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fetch the artifact upload URL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Fetching the artifact upload URL..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($artifactUrl) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Artifact URL successfully fetched: $artifactUrl" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Error "Failed to fetch the artifact URL." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Download the artifact (zipped file) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Starting artifact download..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactZipPath = "$env:TEMP\artifact.zip" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Invoke-WebRequest -Uri $artifactUrl ` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -Headers $headers ` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -OutFile $artifactZipPath ` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -MaximumRedirection 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Artifact downloaded successfully to $artifactZipPath" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Error "Error downloading artifact: $_" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Unzip the artifact | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactUnzipPath = "$env:TEMP\artifact" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Unzipping the artifact to $artifactUnzipPath..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Artifact unzipped successfully to $artifactUnzipPath" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Error "Failed to unzip the artifact: $_" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Find the installer or app executable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($artifactInstallerPath) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Executable file found: $($artifactInstallerPath.FullName)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Error "Executable file not found. Exiting." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Run the installer and log the result | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Start-Process -FilePath $artifactInstallerPath.FullName -Wait | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Installer ran successfully." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Error "Failed to run the installer: $_" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Optional: If the app executable is different from the installer, find and launch it | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Launching the application: $($wavePath)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Start-Process -FilePath $wavePath | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Application launched." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prompt: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. /run testdriver/onboarding.yml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Update Check Run | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/github-script@v7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| script: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const checkId = steps['create-check'].outputs.result; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await github.rest.checks.update({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| owner: context.repo.owner, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repo: context.repo.repo, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| check_run_id: checkId, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| status: 'completed', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| conclusion: steps.testdriver.outcome === 'success' ? 'success' : 'failure', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| output: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| title: 'TestDriver.ai Results', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| summary: steps.testdriver.outcome === 'success' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ? '✅ All tests passed' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| : '❌ Tests failed' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: testdriverai/action@main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: testdriver | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FORCE_COLOR: "3" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key: ${{ secrets.DASHCAM_API }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prerun: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $headers = @{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Authorization = "token ${{ secrets.GITHUB_TOKEN }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $downloadFolder = "./download" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactFileName = "waveterm.exe" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactFilePath = "$downloadFolder/$artifactFileName" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Starting the artifact download process..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Create the download directory if it doesn't exist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (-not (Test-Path -Path $downloadFolder)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Creating download folder..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mkdir $downloadFolder | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Download folder already exists." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fetch the artifact upload URL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Fetching the artifact upload URL..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($artifactUrl) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Artifact URL successfully fetched: $artifactUrl" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Error "Failed to fetch the artifact URL." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Download the artifact (zipped file) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Starting artifact download..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactZipPath = "$env:TEMP\artifact.zip" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Invoke-WebRequest -Uri $artifactUrl ` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -Headers $headers ` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -OutFile $artifactZipPath ` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -MaximumRedirection 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Artifact downloaded successfully to $artifactZipPath" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Error "Error downloading artifact: $_" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Unzip the artifact | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactUnzipPath = "$env:TEMP\artifact" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Unzipping the artifact to $artifactUnzipPath..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Artifact unzipped successfully to $artifactUnzipPath" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Error "Failed to unzip the artifact: $_" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Find the installer or app executable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($artifactInstallerPath) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Executable file found: $($artifactInstallerPath.FullName)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Error "Executable file not found. Exiting." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+114
to
+121
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add validation of artifact content before execution. The script executes the first Add validation steps: - $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1
+ # Expected installer name pattern
+ $expectedInstallerPattern = "waveterm-setup-*.exe"
+
+ # Find installer matching expected pattern
+ $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter $expectedInstallerPattern -Recurse | Select-Object -First 1
+
+ # Validate digital signature if applicable
+ if ($artifactInstallerPath) {
+ $signature = Get-AuthenticodeSignature -FilePath $artifactInstallerPath.FullName
+ if ($signature.Status -ne "Valid") {
+ Write-Error "Invalid digital signature on installer: $($signature.Status)"
+ exit 1
+ }
+ }📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Run the installer and log the result | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Start-Process -FilePath $artifactInstallerPath.FullName -Wait | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Installer ran successfully." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Error "Failed to run the installer: $_" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+124
to
+131
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add timeout handling for installer process. The Write-Host "Running the installer: $($artifactInstallerPath.FullName)..."
try {
- Start-Process -FilePath $artifactInstallerPath.FullName -Wait
+ $process = Start-Process -FilePath $artifactInstallerPath.FullName -Wait -PassThru
+ $processExited = $process.WaitForExit(300000) # 5-minute timeout
+ if (-not $processExited) {
+ $process.Kill()
+ throw "Installer process timed out after 5 minutes"
+ }
Write-Host "Installer ran successfully."
} catch {📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Optional: If the app executable is different from the installer, find and launch it | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Launching the application: $($wavePath)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Start-Process -FilePath $wavePath | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-Host "Application launched." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+133
to
+139
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add error handling for application launch. The application launch step lacks proper error handling and verification. # Optional: If the app executable is different from the installer, find and launch it
- $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe"
+ $waveInstallDir = Join-Path $env:LOCALAPPDATA "Programs\waveterm"
+ $wavePath = Join-Path $waveInstallDir "Wave.exe"
- Write-Host "Launching the application: $($wavePath)"
- Start-Process -FilePath $wavePath
- Write-Host "Application launched."
+ if (Test-Path $wavePath) {
+ Write-Host "Launching the application: $($wavePath)"
+ try {
+ $process = Start-Process -FilePath $wavePath -PassThru
+ Start-Sleep -Seconds 5 # Give the app time to start
+ if ($process.HasExited) {
+ throw "Application crashed on startup"
+ }
+ Write-Host "Application launched successfully."
+ } catch {
+ Write-Error "Failed to launch application: $_"
+ exit 1
+ }
+ } else {
+ Write-Error "Application executable not found at expected path: $wavePath"
+ exit 1
+ }📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prompt: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. /run testdriver/onboarding.yml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin the action version for stability.
Using
@mainis not recommended as it points to a mutable ref. Since this PR is upgrading to v1.1.0, you should pin the action to this specific version.📝 Committable suggestion