File tree Expand file tree Collapse file tree
extension/BuildPhpExtension/private Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,15 +19,18 @@ Function Get-CheckoutState {
1919 $checkout_state = $true ;
2020 if ([string ]::IsNullOrWhiteSpace($Repository ) -or -not (Test-Path .git)) {
2121 $checkout_state = $false
22- }
23- try {
24- $originUrl = git remote get-url origin 2> $null
25- if ($LASTEXITCODE -ne 0 -or [string ]::IsNullOrWhiteSpace($originUrl )) {
22+ } else {
23+ try {
24+ $originUrl = git remote get-url origin 2> $null
25+ if ($LASTEXITCODE -ne 0 -or [string ]::IsNullOrWhiteSpace($originUrl )) {
26+ $checkout_state = $false
27+ } else {
28+ $checkout_state = ($originUrl -match " (^|[:/])$ ( [regex ]::Escape($Repository ) ) (\.git)?$" )
29+ }
30+ }
31+ catch {
2632 $checkout_state = $false
2733 }
28- $checkout_state = ($originUrl -match " (^|[:/])$ ( [regex ]::Escape($Repository )) (\.git)?$" )
29- } catch {
30- $checkout_state = $false
3134 }
3235 $checkout_state = $checkout_state.ToString ().ToLowerInvariant()
3336 if ($null -ne $env: GITHUB_OUTPUT ) {
You can’t perform that action at this time.
0 commit comments