-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.ps1
38 lines (32 loc) · 1.17 KB
/
entrypoint.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function Main()
{
[OutputType([Void])]
param ([string[]] $inputArgs)
# Remove any arg that is empty or whitespace. This removes empty strings that are passed from the action.yml.
# This is a workaround to deal with non-required action inputs when this script is called via the action.yml.
$argsAsList = [Collections.Generic.List[String]]::new()
foreach ($arg in $inputArgs)
{
if (![string]::IsNullOrWhiteSpace($arg))
{
$argsAsList.Add($arg)
}
}
Write-Output "Executing: dotnet '/app/MarkdownLinkCheckLogParserCli.dll' $argsAsList"
$output = dotnet '/app/MarkdownLinkCheckLogParserCli.dll' $argsAsList
if ($LASTEXITCODE -ne 0 )
{
Write-Output "::error::Markdown link check log parser didn't complete successfully. See the step's log for more details."
exit $LASTEXITCODE
}
$random = Get-Random
$delimiter = "EOF_$random"
Write-Output "mlc-result<<$delimiter" >> $env:GITHUB_OUTPUT
Write-Output $output >> $env:GITHUB_OUTPUT
Write-Output $delimiter >> $env:GITHUB_OUTPUT
Write-Output "::group::Markdown link check log parser output"
Write-Output $output
Write-Output "::endgroup::"
}
# invoke entrypoint function
Main $args