Skip to content

Commit 31f293b

Browse files
authored
Enhance auto-complete PR workflow for nuspec updates
Added condition to consider PRs updating nuspec files as passed.
1 parent ea23a70 commit 31f293b

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/auto-complete-pr.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ jobs:
5959
$checksJson = gh pr checks $pr.number --json bucket,name,state | ConvertFrom-Json
6060
6161
if ($checksJson.Count -eq 0) {
62-
Write-Host " No checks found, considering as passed"
63-
$completablePr = $pr
62+
Write-Host " No checks found"
63+
if ($pr.title.StartsWith("Update") -and $pr.title.EndsWith(".nuspec")) {
64+
Write-Host "`n PR updates nuspec file - considering as passed"
65+
$completablePr = $pr
66+
}
6467
break
6568
}
6669
@@ -91,7 +94,12 @@ jobs:
9194
Write-Host "`n Completing PR #$($completablePr.number): $($completablePr.title)"
9295
9396
try {
94-
gh pr merge $completablePr.number --merge --delete-branch
97+
if ($completablePr.title.StartsWith("Update") -and $completablePr.title.EndsWith(".nuspec")) {
98+
gh pr merge $completablePr.number --merge --delete-branch --admin
99+
} else {
100+
gh pr merge $completablePr.number --merge --delete-branch
101+
}
102+
95103
96104
Write-Host "Successfully completed PR #$($completablePr.number)"
97105
@@ -108,4 +116,4 @@ jobs:
108116
Write-Host "Failed to complete PR #$($completablePr.number): $_" >> $env:GITHUB_STEP_SUMMARY
109117
110118
exit 1
111-
}
119+
}

0 commit comments

Comments
 (0)