File tree Expand file tree Collapse file tree
.github/actions/Get-PSModuleSettings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ function Select-PullRequestForPush {
105105
106106 $PullRequest |
107107 Where-Object {
108- $_.Base.Ref -eq $DefaultBranch -and
108+ $_.Base.Ref -ceq $DefaultBranch -and
109109 -not [string ]::IsNullOrWhiteSpace($_.merged_at ) -and
110110 $_.merge_commit_sha -eq $CommitSha
111111 } |
@@ -161,7 +161,7 @@ function Get-DiscardedReleasePullRequest {
161161
162162 foreach ($candidate in ($PullRequest | Where-Object { $null -ne $_ })) {
163163 $isMergedToDefaultBranch = (
164- $candidate.Base.Ref -eq $DefaultBranch -and
164+ $candidate.Base.Ref -ceq $DefaultBranch -and
165165 -not [string ]::IsNullOrWhiteSpace($candidate.merged_at )
166166 )
167167 if (-not $isMergedToDefaultBranch ) { continue }
Original file line number Diff line number Diff line change @@ -83,6 +83,15 @@ Describe 'Resolve-WorkflowEventRouting' {
8383}
8484
8585Describe ' Select-PullRequestForPush' {
86+ It ' does not select a merged PR targeting a differently cased branch' {
87+ $request = [pscustomobject ]@ {
88+ Base = [pscustomobject ]@ { Ref = ' Main' }; merged_at = ' 2026-09-01T00:00:00Z' ; merge_commit_sha = ' pushed-sha'
89+ }
90+
91+ Select-PullRequestForPush - PullRequest @ ($request ) - DefaultBranch main - CommitSha pushed- sha |
92+ Should - BeNullOrEmpty
93+ }
94+
8695 It ' selects the merged PR whose merge commit matches the pushed commit' {
8796 $pullRequests = @ (
8897 [pscustomobject ]@ {
@@ -357,6 +366,14 @@ Describe 'Resolve-ReleasePullRequest' {
357366}
358367
359368Describe ' Get-DiscardedReleasePullRequest' {
369+ It ' does not reject a release based on another differently cased branch' {
370+ $request = [pscustomobject ]@ {
371+ Base = [pscustomobject ]@ { Ref = ' Main' }; merged_at = ' 2026-09-01T00:00:00Z' ; merge_commit_sha = ' other-sha'
372+ }
373+
374+ @ (Get-DiscardedReleasePullRequest - PullRequest @ ($request ) - DefaultBranch main - CommitSha pushed- sha).Count |
375+ Should - Be 0
376+ }
360377 It ' reports a merged default-branch pull request that does not match the released commit' {
361378 $pullRequests = @ (
362379 [pscustomobject ]@ {
You can’t perform that action at this time.
0 commit comments