Skip to content

Commit

Permalink
fix: ugit action checking before -InstallModule ( Fixes #290 )
Browse files Browse the repository at this point in the history
Also, importing from workspace if found
  • Loading branch information
James Brundage committed Oct 15, 2024
1 parent f44fc16 commit ef5b0ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Build/GitHub/Actions/UGitAction.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ function InstallActionModule {
$(Get-Content $_.FullName -Raw) -match 'ModuleVersion'
}
if (-not $moduleInWorkspace) {
Install-Module $moduleToInstall -Scope CurrentUser -Force
$availableModules = Get-Module -ListAvailable
if ($availableModules.Name -notcontains $moduleToInstall) {
Install-Module $moduleToInstall -Scope CurrentUser -Force -AcceptLicense -AllowClobber
}
Import-Module $moduleToInstall -Force -PassThru | Out-Host
} else {
Import-Module $moduleInWorkspace.FullName -Force -PassThru | Out-Host
}
}
function ImportActionModule {
Expand Down
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,13 @@ runs:
$(Get-Content $_.FullName -Raw) -match 'ModuleVersion'
}
if (-not $moduleInWorkspace) {
Install-Module $moduleToInstall -Scope CurrentUser -Force
$availableModules = Get-Module -ListAvailable
if ($availableModules.Name -notcontains $moduleToInstall) {
Install-Module $moduleToInstall -Scope CurrentUser -Force -AcceptLicense -AllowClobber
}
Import-Module $moduleToInstall -Force -PassThru | Out-Host
} else {
Import-Module $moduleInWorkspace.FullName -Force -PassThru | Out-Host
}
}
function ImportActionModule {
Expand Down

0 comments on commit ef5b0ee

Please sign in to comment.