From ecfcb51e3760c470ce9d301d3c240507e950ccd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 2 Jul 2024 22:13:47 +0200 Subject: [PATCH 01/15] More expressive variable name --- .../actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index 2985b808d..57b89ba03 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -38,7 +38,7 @@ $buildSwitches = ConvertTo-Array @" "@ [array] $expectedErrorCodes = ConvertTo-Array $ExpectedCodeAnalysisErrors | ForEach-Object { $PSItem.Split(':')[0] } | Sort-Object -$noErrors = $expectedErrorCodes.Count -eq 0 +$noErrorsExpected = $expectedErrorCodes.Count -eq 0 if (Test-Path src/Utilities/Lombiq.Gulp.Extensions/Lombiq.Gulp.Extensions.csproj) { @@ -70,10 +70,10 @@ dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { $errorLines.Add($PSItem) if ($message.Contains(':')) { $errorCodes.Add($message.Split(':')[0].Trim()) } - if ($noErrors) { Write-Output "::error file=$file,line=$line,col=$column::$message" } + if ($noErrorsExpected) { Write-Output "::error file=$file,line=$line,col=$column::$message" } } -if ($noErrors -and -not $?) +if ($noErrorsExpected -and -not $?) { exit 1 } From 9d51be9c321f7ea7fbc33ebc662d504bd81d0e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 2 Jul 2024 22:20:03 +0200 Subject: [PATCH 02/15] Displaying the raw build error message too --- .../actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index 57b89ba03..ed7841a74 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -70,7 +70,11 @@ dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { $errorLines.Add($PSItem) if ($message.Contains(':')) { $errorCodes.Add($message.Split(':')[0].Trim()) } - if ($noErrorsExpected) { Write-Output "::error file=$file,line=$line,col=$column::$message" } + if ($noErrorsExpected) + { + Write-Output "::error::$PSItem" + Write-Output "::error file=$file,line=$line,col=$column::$message" + } } if ($noErrorsExpected -and -not $?) From c868728f980c9d6428722287fdeb0a46eb95657b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 2 Jul 2024 22:20:16 +0200 Subject: [PATCH 03/15] Pointing GHA to issue branch --- .github/actions/publish-nuget/action.yml | 2 +- .github/workflows/build-and-test-dotnet.yml | 2 +- .github/workflows/build-and-test-orchard-core.yml | 2 +- .github/workflows/build-dotnet.yml | 2 +- .github/workflows/deploy-to-azure-app-service.yml | 2 +- .github/workflows/test-analysis-failure.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index 57cc25243..509fa7d47 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -128,7 +128,7 @@ runs: run: ./ConvertTo-Nuspec.ps1 '${{ steps.setup.outputs.publish-version }}' - name: Build - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 # Notes on the configuration: # * -p:NuGetBuild=true is our property to load Lombiq dependencies from NuGet by switching project references # to package references. diff --git a/.github/workflows/build-and-test-dotnet.yml b/.github/workflows/build-and-test-dotnet.yml index 6b95c60a5..67c54c75d 100644 --- a/.github/workflows/build-and-test-dotnet.yml +++ b/.github/workflows/build-and-test-dotnet.yml @@ -205,7 +205,7 @@ jobs: exclude-project-path: ${{ inputs.dotnet-consolidation-exclude-project-path }} - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 with: directory: ${{ inputs.build-directory}} configuration: ${{ inputs.build-configuration}} diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index 1c81a81a2..7f9337c9f 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -231,7 +231,7 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@dev - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 with: directory: ${{ inputs.build-directory }} configuration: ${{ inputs.build-configuration}} diff --git a/.github/workflows/build-dotnet.yml b/.github/workflows/build-dotnet.yml index 9459a40a1..f44878afe 100644 --- a/.github/workflows/build-dotnet.yml +++ b/.github/workflows/build-dotnet.yml @@ -104,7 +104,7 @@ jobs: directory: ${{ inputs.build-directory }} - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 with: directory: ${{ inputs.build-directory}} verbosity: ${{ inputs.build-verbosity}} diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 6f8c06d47..76b30bca5 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -166,7 +166,7 @@ jobs: "runtime-option=--runtime=${{ inputs.runtime }}" >> $Env:GITHUB_OUTPUT - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 with: directory: ${{ inputs.build-directory }} verbosity: ${{ inputs.build-verbosity }} diff --git a/.github/workflows/test-analysis-failure.yml b/.github/workflows/test-analysis-failure.yml index e7d5ca4b3..a5d09657e 100644 --- a/.github/workflows/test-analysis-failure.yml +++ b/.github/workflows/test-analysis-failure.yml @@ -87,7 +87,7 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@dev - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 with: directory: ${{ inputs.build-directory }} verbosity: quiet From c5e4d8318f829bec6806dd113004be19bfd03969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 2 Jul 2024 22:22:37 +0200 Subject: [PATCH 04/15] Pointing GHA to issue branch --- .github/workflows/publish-nuget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 2541bc365..b5a03265c 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -75,7 +75,7 @@ jobs: dotnet-version: ${{ inputs.dotnet-version }} - name: Publish to NuGet - uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@dev + uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@issue/OSOE-874 with: source: ${{ inputs.source }} verbosity: ${{ inputs.verbosity }} From 6bb49d360f7f70431cbce024ed2762274a53cff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 2 Jul 2024 22:29:28 +0200 Subject: [PATCH 05/15] Attempting relative file path in error message --- .github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index ed7841a74..5dc4eb4e9 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -73,7 +73,7 @@ dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { if ($noErrorsExpected) { Write-Output "::error::$PSItem" - Write-Output "::error file=$file,line=$line,col=$column::$message" + Write-Output "::error file=test/Lombiq.OSOCE.Tests.UI/UITestBase.cs,line=$line,col=$column::$message" } } From c399c2153470777df7d3fee20aed0a836510fcc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 2 Jul 2024 22:30:16 +0200 Subject: [PATCH 06/15] Ignoring .binlog files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 66e85ec0b..f9c1aa0b5 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ node_modules/ *.user .pnpm-debug.log /.editorconfig +*.binlog From 954ec6b22e37f3c1fe7c04a89d66f7a22712bb80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 2 Jul 2024 22:45:40 +0200 Subject: [PATCH 07/15] Trying to set error titles too --- .github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index 5dc4eb4e9..c84b983c4 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -73,7 +73,7 @@ dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { if ($noErrorsExpected) { Write-Output "::error::$PSItem" - Write-Output "::error file=test/Lombiq.OSOCE.Tests.UI/UITestBase.cs,line=$line,col=$column::$message" + Write-Output "::error file=test/Lombiq.OSOCE.Tests.UI/UITestBase.cs,line=$line,col=$column,title=BuildError::$message" } } From 1b2665b2c8fa7c339b923c6ee833956c616d6708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 2 Jul 2024 23:14:22 +0200 Subject: [PATCH 08/15] Another debug output --- .github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index c84b983c4..e2daf0f1a 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -72,6 +72,7 @@ dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { if ($message.Contains(':')) { $errorCodes.Add($message.Split(':')[0].Trim()) } if ($noErrorsExpected) { + Write-Output "::error:: This is a debug message: file=test/Lombiq.OSOCE.Tests.UI/UITestBase.cs,line=$line,col=$column,title=BuildError" Write-Output "::error::$PSItem" Write-Output "::error file=test/Lombiq.OSOCE.Tests.UI/UITestBase.cs,line=$line,col=$column,title=BuildError::$message" } From e7d922c7ac909391c5190da75113d04e16d0c55b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 2 Jul 2024 23:28:43 +0200 Subject: [PATCH 09/15] Simply running dotnet build when no errors are expected --- .../Build-DotNetSolutionOrProject.ps1 | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index e2daf0f1a..25c2f76c2 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -62,19 +62,20 @@ Write-Output "Building solution or project with ``dotnet build $SolutionOrProjec $errorLines = New-Object 'System.Collections.Generic.List[string]' $errorCodes = New-Object 'System.Collections.Generic.List[string]' -$errorFormat = '^(.*)\((\d+),(\d+)\): error (.*)' -dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { - if ($PSItem -notmatch $errorFormat) { return $PSItem } - - ($null, $file, $line, $column, $message) = [regex]::Match($PSItem, $errorFormat, 'Compiled').Groups.Value - - $errorLines.Add($PSItem) - if ($message.Contains(':')) { $errorCodes.Add($message.Split(':')[0].Trim()) } - if ($noErrorsExpected) - { - Write-Output "::error:: This is a debug message: file=test/Lombiq.OSOCE.Tests.UI/UITestBase.cs,line=$line,col=$column,title=BuildError" - Write-Output "::error::$PSItem" - Write-Output "::error file=test/Lombiq.OSOCE.Tests.UI/UITestBase.cs,line=$line,col=$column,title=BuildError::$message" +if ($noErrorsExpected) +{ + dotnet build $SolutionOrProject +} +else +{ + $errorFormat = '^(.*)\((\d+),(\d+)\): error (.*)' + dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { + if ($PSItem -notmatch $errorFormat) { return $PSItem } + + ($null, $file, $line, $column, $message) = [regex]::Match($PSItem, $errorFormat, 'Compiled').Groups.Value + + $errorLines.Add($PSItem) + if ($message.Contains(':')) { $errorCodes.Add($message.Split(':')[0].Trim()) } } } From 33bc2dae6ef22e41f92b677b4ce80bef8ff3dd47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 2 Jul 2024 23:34:41 +0200 Subject: [PATCH 10/15] Adding missing build switches --- .github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index 25c2f76c2..c02f06cbb 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -64,7 +64,7 @@ $errorCodes = New-Object 'System.Collections.Generic.List[string]' if ($noErrorsExpected) { - dotnet build $SolutionOrProject + dotnet build $SolutionOrProject @buildSwitches } else { From fc5e38f33fda88ffb7b7f37490582ae4de0393c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 2 Jul 2024 23:59:07 +0200 Subject: [PATCH 11/15] Removing whitespace --- .../actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index c02f06cbb..fcd399c16 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -71,9 +71,9 @@ else $errorFormat = '^(.*)\((\d+),(\d+)\): error (.*)' dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { if ($PSItem -notmatch $errorFormat) { return $PSItem } - + ($null, $file, $line, $column, $message) = [regex]::Match($PSItem, $errorFormat, 'Compiled').Groups.Value - + $errorLines.Add($PSItem) if ($message.Contains(':')) { $errorCodes.Add($message.Split(':')[0].Trim()) } } From 4952f86962aed13982fff2bb7c3d5e006294bace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Wed, 3 Jul 2024 16:06:56 +0200 Subject: [PATCH 12/15] Revert branch selectors --- .github/actions/publish-nuget/action.yml | 2 +- .github/workflows/build-and-test-dotnet.yml | 2 +- .github/workflows/build-and-test-orchard-core.yml | 2 +- .github/workflows/build-dotnet.yml | 2 +- .github/workflows/deploy-to-azure-app-service.yml | 2 +- .github/workflows/publish-nuget.yml | 2 +- .github/workflows/test-analysis-failure.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index 509fa7d47..57cc25243 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -128,7 +128,7 @@ runs: run: ./ConvertTo-Nuspec.ps1 '${{ steps.setup.outputs.publish-version }}' - name: Build - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev # Notes on the configuration: # * -p:NuGetBuild=true is our property to load Lombiq dependencies from NuGet by switching project references # to package references. diff --git a/.github/workflows/build-and-test-dotnet.yml b/.github/workflows/build-and-test-dotnet.yml index 67c54c75d..6b95c60a5 100644 --- a/.github/workflows/build-and-test-dotnet.yml +++ b/.github/workflows/build-and-test-dotnet.yml @@ -205,7 +205,7 @@ jobs: exclude-project-path: ${{ inputs.dotnet-consolidation-exclude-project-path }} - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev with: directory: ${{ inputs.build-directory}} configuration: ${{ inputs.build-configuration}} diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index 7f9337c9f..1c81a81a2 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -231,7 +231,7 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@dev - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev with: directory: ${{ inputs.build-directory }} configuration: ${{ inputs.build-configuration}} diff --git a/.github/workflows/build-dotnet.yml b/.github/workflows/build-dotnet.yml index f44878afe..9459a40a1 100644 --- a/.github/workflows/build-dotnet.yml +++ b/.github/workflows/build-dotnet.yml @@ -104,7 +104,7 @@ jobs: directory: ${{ inputs.build-directory }} - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev with: directory: ${{ inputs.build-directory}} verbosity: ${{ inputs.build-verbosity}} diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 76b30bca5..6f8c06d47 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -166,7 +166,7 @@ jobs: "runtime-option=--runtime=${{ inputs.runtime }}" >> $Env:GITHUB_OUTPUT - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev with: directory: ${{ inputs.build-directory }} verbosity: ${{ inputs.build-verbosity }} diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index b5a03265c..2541bc365 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -75,7 +75,7 @@ jobs: dotnet-version: ${{ inputs.dotnet-version }} - name: Publish to NuGet - uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@issue/OSOE-874 + uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@dev with: source: ${{ inputs.source }} verbosity: ${{ inputs.verbosity }} diff --git a/.github/workflows/test-analysis-failure.yml b/.github/workflows/test-analysis-failure.yml index a5d09657e..e7d5ca4b3 100644 --- a/.github/workflows/test-analysis-failure.yml +++ b/.github/workflows/test-analysis-failure.yml @@ -87,7 +87,7 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@dev - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-874 + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev with: directory: ${{ inputs.build-directory }} verbosity: quiet From 1fb368b1c1be861678d341de4f9565f559d609e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 3 Jul 2024 17:29:48 +0200 Subject: [PATCH 13/15] Making Get-GhaItemsFromFileList not fail on missing .gitignore --- .../Get-GhaItemsFromFileList.ps1 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/actions/get-changed-gha-items/Get-GhaItemsFromFileList.ps1 b/.github/actions/get-changed-gha-items/Get-GhaItemsFromFileList.ps1 index 49f799c8c..e64028946 100644 --- a/.github/actions/get-changed-gha-items/Get-GhaItemsFromFileList.ps1 +++ b/.github/actions/get-changed-gha-items/Get-GhaItemsFromFileList.ps1 @@ -4,7 +4,18 @@ # Filter actions based on files in action directory. [array]$actionFiles = $FileIncludeList | Where-Object -FilterScript { - $itemDirectory = (Get-Item $PSItem).Directory.FullName + # The try-catch is necessary to not fail on files that are changed but not in the working directory. At least + # .gitignore files are like this. + try + { + $item = Get-Item $PSItem -ErrorAction Stop + $itemDirectory = $item.Directory.FullName + } + catch + { + return $false + } + $isInGitHubDir = $itemDirectory -like '*/.github/*' -or $itemDirectory -eq '*/.github' if (-not $isInGitHubDir) { From 80b8a51777a20b667573d32960c8f8a026c4f6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 3 Jul 2024 17:30:16 +0200 Subject: [PATCH 14/15] Pointing GHA to issue branch --- .github/workflows/validate-this-gha-refs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-this-gha-refs.yml b/.github/workflows/validate-this-gha-refs.yml index e822df0d4..ee6f25658 100644 --- a/.github/workflows/validate-this-gha-refs.yml +++ b/.github/workflows/validate-this-gha-refs.yml @@ -53,7 +53,7 @@ jobs: - name: Get GitHub Actions Item Changes from File Changes id: changed-items if: github.event_name == 'pull_request' || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved') || github.event_name == 'merge_group' - uses: Lombiq/GitHub-Actions/.github/actions/get-changed-gha-items@dev + uses: Lombiq/GitHub-Actions/.github/actions/get-changed-gha-items@issue/OSOE-874 with: file-include-list: '${{ steps.git-diff.outputs.changed-files }}' From ea525b0ee62cef09d7ea9e1fa872c9807b577f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 3 Jul 2024 17:32:32 +0200 Subject: [PATCH 15/15] Revert "Pointing GHA to issue branch" This reverts commit 80b8a51777a20b667573d32960c8f8a026c4f6bf. --- .github/workflows/validate-this-gha-refs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-this-gha-refs.yml b/.github/workflows/validate-this-gha-refs.yml index ee6f25658..e822df0d4 100644 --- a/.github/workflows/validate-this-gha-refs.yml +++ b/.github/workflows/validate-this-gha-refs.yml @@ -53,7 +53,7 @@ jobs: - name: Get GitHub Actions Item Changes from File Changes id: changed-items if: github.event_name == 'pull_request' || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved') || github.event_name == 'merge_group' - uses: Lombiq/GitHub-Actions/.github/actions/get-changed-gha-items@issue/OSOE-874 + uses: Lombiq/GitHub-Actions/.github/actions/get-changed-gha-items@dev with: file-include-list: '${{ steps.git-diff.outputs.changed-files }}'