diff --git a/Get-Changed-Components.ps1 b/Get-Changed-Components.ps1 index 1e9d714..8d06acb 100644 --- a/Get-Changed-Components.ps1 +++ b/Get-Changed-Components.ps1 @@ -30,6 +30,8 @@ if (-not $ToSha) { $ToSha = $(git rev-parse HEAD) } +# Ensure that orphaned commits are available for diffing (e.g. when force-pushed). +git fetch origin $FromSha git fetch origin main $changedComponentFiles = Invoke-Expression "git diff --name-only $($FromSha)...$($ToSha) -- components/" -ErrorAction Stop