Skip to content

Commit 516cd61

Browse files
Enhance job run conditions logging and refine pull request state checks
1 parent 77c3c59 commit 516cd61

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

scripts/main.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,17 @@ $settings | Add-Member -MemberType NoteProperty -Name WorkingDirectory -Value $w
192192
# Calculate job run conditions
193193
LogGroup 'Calculate Job Run Conditions:' {
194194
# Common conditions
195+
Write-Host 'GitHub event inputs:'
196+
[pscustomobject]@{
197+
GITHUB_EVENT_NAME = $env:GITHUB_EVENT_NAME
198+
GITHUB_EVENT_ACTION = $env:GITHUB_EVENT_ACTION
199+
GITHUB_EVENT_PULL_REQUEST_MERGED = $env:GITHUB_EVENT_PULL_REQUEST_MERGED
200+
} | Format-List | Out-String
201+
195202
$isPR = $env:GITHUB_EVENT_NAME -eq 'pull_request'
196-
$isOpenOrUpdatedPR = $isPR -and $env:GITHUB_EVENT_ACTION -ne 'closed'
203+
$isOpenOrUpdatedPR = $isPR -and $env:GITHUB_EVENT_ACTION -in @('opened', 'reopened', 'synchronize')
197204
$isAbandonedPR = $isPR -and $env:GITHUB_EVENT_ACTION -eq 'closed' -and $env:GITHUB_EVENT_PULL_REQUEST_MERGED -ne 'true'
198-
$isMergedPR = $isPR -and $env:GITHUB_EVENT_PULL_REQUEST_MERGED -eq 'true'
205+
$isMergedPR = $isPR -and $env:GITHUB_EVENT_ACTION -eq 'closed' -and $env:GITHUB_EVENT_PULL_REQUEST_MERGED -eq 'true'
199206
$isNotAbandonedPR = -not $isAbandonedPR
200207

201208
[pscustomobject]@{

0 commit comments

Comments
 (0)