@@ -56,20 +56,26 @@ runs:
5656 param ($CsprojPath, $CurrentHash, $PrevHash)
5757
5858 $projectDirectoryPath = "$(Split-Path -Path $CsprojPath)"
59+ Write-Host "Checking changes in: $projectDirectoryPath"
5960 $output = $(git diff --quiet "$($CurrentHash):$($projectDirectoryPath -replace '\\', '/')" "$($PrevHash):$($projectDirectoryPath -replace '\\', '/')" -- ':!*.nuspec'; $LASTEXITCODE -ne 0)
6061
6162 if ($output) {
63+ Write-Host " -> Direct changes detected in $projectDirectoryPath"
6264 return $output;
6365 }
6466
6567 $csproj = [xml](Get-Content "$($CsprojPath)")
6668 $projectReferences = $csproj.Project.ItemGroup.ProjectReference | Where-Object { $_ -ne $null }
69+ Write-Host " -> Checking $($projectReferences.Count) project references"
6770 foreach ($projectReference in $projectReferences) {
6871 if (-not([string]::IsNullOrWhitespace($projectReference.IncludeAssets)) -and $projectReference.IncludeAssets -ne "All") {
72+ Write-Host " -> Skipping reference (IncludeAssets != All): $($projectReference.Include)"
6973 continue;
7074 }
7175
72- $output = HasChanges -CsprojPath "$(Resolve-RelativePath $([IO.Path]::Combine($projectDirectoryPath, $projectReference.Include)))" -CurrentHash $CurrentHash -PrevHash $PrevHash
76+ $refPath = "$(Resolve-RelativePath $([IO.Path]::Combine($projectDirectoryPath, $projectReference.Include)))"
77+ Write-Host " -> Checking reference: $refPath"
78+ $output = HasChanges -CsprojPath $refPath -CurrentHash $CurrentHash -PrevHash $PrevHash
7379 if ($output) {
7480 break;
7581 }
@@ -79,30 +85,39 @@ runs:
7985 }
8086
8187 $SelectedProject = "${{ inputs.project }}"
88+ Write-Host "Checking project: $SelectedProject"
8289
8390 $currentHash = git rev-parse HEAD
8491 if (-not $currentHash) {
8592 Write-Host "Cannot fetch hash of HEAD"
8693 exit 1
8794 }
95+ Write-Host "Current hash: $currentHash"
8896
8997 # Fetch hash of last release based on the project input
9098 $lastReleaseHash = git tag -l "$($SelectedProject)/*" | Sort-Object { [version]($_ -split '/' | Select-Object -Last 1) } | Select-Object -Last 1 | ForEach-Object { git rev-list -n 1 $_ }
9199 if (-not $lastReleaseHash) {
92100 Write-Host "Cannot fetch hash of last release"
93101 exit 1
94102 }
103+ Write-Host "Last release hash: $lastReleaseHash"
95104
96105 $csProjPath = "$([IO.Path]::Combine(".", "$($SelectedProject)", "$($SelectedProject).csproj"))"
106+ Write-Host "Starting change detection for: $csProjPath"
97107 $hasDifferences = HasChanges -CsprojPath $csProjPath -CurrentHash $currentHash -PrevHash $lastReleaseHash
108+
98109 if ($hasDifferences) {
110+ Write-Host "Changes detected, checking nuspec..."
99111 $nuspecPath = "$([IO.Path]::Combine(".", "$($SelectedProject)", "$($SelectedProject).nuspec"))"
100112 [xml]$nuspec = Get-Content $nuspecPath
101113 $hashFromNuspec = $nuspec.package.metadata.repository.commit
102114 if ($hashFromNuspec) {
115+ Write-Host "Nuspec commit hash found: $hashFromNuspec - rechecking against this hash"
103116 $hasDifferences = HasChanges -CsprojPath $csProjPath -CurrentHash $currentHash -PrevHash $hashFromNuspec
104117 }
105118 }
106119
120+ Write-Host "Final result: $hasDifferences"
107121 "result=$("$($hasDifferences)".ToLowerInvariant())" >> $env:GITHUB_OUTPUT
108122 exit 0
123+
0 commit comments