diff --git a/bin/auto-pr.ps1 b/bin/auto-pr.ps1 index e6386a7bc..3d2a15f35 100644 --- a/bin/auto-pr.ps1 +++ b/bin/auto-pr.ps1 @@ -185,8 +185,8 @@ hub diff --name-only | ForEach-Object { # detect if file was staged, because it's not when only LF or CRLF have changed $status = execute 'hub status --porcelain -uno' - $status = $status | Select-Object -First 1 - if ($status -and $status -match "^\x20*M\x20+.*$app.json") { + $status = $status | Where-Object { $_ -match "M\s{2}.*$app.json" } + if ($status -and $status.StartsWith('M ') -and $status.EndsWith("$app.json")) { execute "hub commit -m '${app}: Update to version $version'" } else { Write-Host "Skipping $app because only LF/CRLF changes were detected ..." -ForegroundColor Yellow