From 35daab0974e67ae4cf7e43eaf5ec9495846f14aa Mon Sep 17 00:00:00 2001 From: Rob Bos Date: Mon, 19 Feb 2024 21:47:38 +0100 Subject: [PATCH] Fix place to return the value --- Src/PowerShell/entrypoint.ps1 | 6 +++++- Src/PowerShell/load-used-actions.ps1 | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Src/PowerShell/entrypoint.ps1 b/Src/PowerShell/entrypoint.ps1 index 939e80a..b137b40 100644 --- a/Src/PowerShell/entrypoint.ps1 +++ b/Src/PowerShell/entrypoint.ps1 @@ -55,9 +55,13 @@ function main { # Get all actions $actions = LoadAllActionsFromConfiguration + if ($null -eq $actions) { + Write-Error "Could not find any actions" + throw + } # write the file outside of the container so we can pick it up - Write-Host "Found [$($actions.Count)] actions " + Write-Host "Found [$($actions.Count)] actions" $jsonObject = ($actions | ConvertTo-Json -Depth 10 -Compress) # store the json in a file and write the path to the output variable diff --git a/Src/PowerShell/load-used-actions.ps1 b/Src/PowerShell/load-used-actions.ps1 index 7e59fee..bb7ee2e 100644 --- a/Src/PowerShell/load-used-actions.ps1 +++ b/Src/PowerShell/load-used-actions.ps1 @@ -10,7 +10,6 @@ param ( # pull in central calls library . $PSScriptRoot\github-calls.ps1 - function GetActionsFromWorkflow { param ( [string] $workflow, @@ -252,7 +251,9 @@ function LoadAllActionsFromConfiguration() { # todo: store the json file #UploadActionsDataToGitHub -actions $actionsFound -marketplaceRepo $marketplaceRepo -PAT $PAT -repositoryName $repositoryName -repositoryOwner $repositoryOwner + + return $summarizeActions } - return $summarizeActions + return $null }