Skip to content

Commit 9163c2c

Browse files
committed
20230323F
1 parent 62603be commit 9163c2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hugoalh.GitHubActionsToolkit/module/utility.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ Function Get-WebhookEventPayload {
7272
Param (
7373
[Alias('ToHashtable')][Switch]$AsHashtable
7474
)
75-
If (![System.IO.Path]::IsPathFullyQualified($Env:GITHUB_EVENT_PATH)) {
76-
Write-Error -Message 'Unable to get the GitHub Actions webhook event payload: Environment path `GITHUB_EVENT_PATH` is not defined or not contain a valid file path!' -Category 'ResourceUnavailable'
75+
If (!([System.IO.Path]::IsPathFullyQualified($Env:GITHUB_EVENT_PATH) -and (Test-Path -LiteralPath $Env:GITHUB_EVENT_PATH -PathType 'Leaf'))) {
76+
Write-Error -Message 'Unable to get the GitHub Actions webhook event payload: Environment path `GITHUB_EVENT_PATH` is not defined or not contain a valid file path, or file is not exist!' -Category 'ResourceUnavailable'
7777
Return
7878
}
7979
Get-Content -LiteralPath $Env:GITHUB_EVENT_PATH -Raw -Encoding 'UTF8NoBOM' |

0 commit comments

Comments
 (0)