Skip to content

Commit 568b193

Browse files
Fix casing for pull request event payload keys
1 parent 5f47163 commit 568b193

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

scripts/main.ps1

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'powershell-yaml', 'Hashtable' | Install-PSResource -Repository PSGallery -TrustRepository
1+
'powershell-yaml', 'Hashtable' | Install-PSResource -Repository PSGallery -TrustRepository
22

33
$name = $env:PSMODULE_GET_SETTINGS_INPUT_Name
44
$settingsPath = $env:PSMODULE_GET_SETTINGS_INPUT_SettingsPath
@@ -209,24 +209,20 @@ LogGroup 'Calculate Job Run Conditions:' {
209209
}
210210
}
211211

212-
$pullRequestAction = if ($null -ne $eventData.action) {
213-
$eventData.action
214-
} elseif ($null -ne $eventData.Action) {
212+
$pullRequestAction = if ($null -ne $eventData.Action) {
215213
$eventData.Action
216214
} else {
217215
$env:GITHUB_EVENT_ACTION
218216
}
219217

220-
$pullRequest = if ($null -ne $eventData.pull_request) {
221-
$eventData.pull_request
222-
} elseif ($null -ne $eventData.PullRequest) {
218+
$pullRequest = if ($null -ne $eventData.PullRequest) {
223219
$eventData.PullRequest
224220
} else {
225221
$null
226222
}
227223

228-
$pullRequestIsMerged = if ($null -ne $pullRequest -and $null -ne $pullRequest.merged) {
229-
[bool]$pullRequest.merged
224+
$pullRequestIsMerged = if ($null -ne $pullRequest -and $null -ne $pullRequest.Merged) {
225+
[bool]$pullRequest.Merged
230226
} else {
231227
$false
232228
}

0 commit comments

Comments
 (0)