Skip to content

Commit 007d1c9

Browse files
committed
Update cd-download-grype-scan.yml
more bugs, rico...
1 parent 1185f8f commit 007d1c9

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/cd-download-grype-scan.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# channel: stable
77
# architecture: x86_64
88
# os-platform: run both ubuntu and windows
9-
# os-platform-version: 24.04 (TODO: make this selectable by Windows and linux separately later)
9+
# os-platform-version: 24.04 or 2022
1010
# download-site: commercial
1111
# license-id: (not specified, uses secret)
1212

@@ -429,11 +429,21 @@ jobs:
429429
if ("${{ inputs.os-platform }}" -eq "windows") {
430430
# Windows downloads are .msi packages - install them
431431
Write-Host "Installing .msi package..."
432-
Start-Process msiexec.exe -ArgumentList "/i", ".\package.msi", "/qn", "/norestart" -Wait
432+
433+
# Create install directory
434+
New-Item -ItemType Directory -Force -Path ".\install"
435+
436+
Start-Process msiexec.exe -ArgumentList "/i", ".\package.msi", "TARGETDIR=\".\\install\"", "/qn", "/norestart" -Wait
433437
# Start-Process msiexec.exe -ArgumentList "/i", "$env:TEMP\package_downloaded", "/qn", "/norestart" -Wait
434438

435439
# Echo where it was installed
436-
Write-Host "Package installed. Common installation paths:"
440+
Write-Host "Package installed."
441+
Write-Host "Checking common installation paths:"
442+
if (Test-Path ".\install") {
443+
Write-Host "Found installation at: .\install"
444+
Get-ChildItem -Path ".\install" -Recurse -Depth 3
445+
# Copy-Item -Path ".\install" -Destination $ExtractPath -Recurse -Force
446+
}
437447
if (Test-Path "C:\opscode\chef") {
438448
Write-Host "Found installation at: C:\opscode\chef"
439449
Get-ChildItem -Path "C:\opscode\chef" -Recurse -Depth 1
@@ -460,7 +470,8 @@ jobs:
460470
- name: Run Grype scan on extracted directory
461471
timeout-minutes: 15 # Sets a 15-minute timeout for this specific step
462472
run: |
463-
$ExtractPath = "$env:TEMP\extracted_packages"
473+
$ExtractPath = ".\install"
474+
# $ExtractPath = "$env:TEMP\extracted_packages"
464475
465476
# run grype in runner
466477
grype dir:$ExtractPath --name ${{ inputs.product }}

0 commit comments

Comments
 (0)