Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
bb657f8
Pass build-create-binary-log.
sarahelsaig Aug 6, 2026
cc42787
Add timeout-minutes for build-dotnet.
sarahelsaig Aug 6, 2026
5e17aa5
Type coercion trickery.
sarahelsaig Aug 6, 2026
92d5d7a
Hard coded value to confirm that this works at all.
sarahelsaig Aug 7, 2026
cc3302f
wat
sarahelsaig Aug 7, 2026
9d8abff
Use pwsh job to do the timeout.
sarahelsaig Aug 7, 2026
7a791b8
Log timeoutMinutes.
sarahelsaig Aug 7, 2026
e4e6629
Invoke-ScriptBlock
sarahelsaig Aug 7, 2026
bd5e440
Invoke-ScriptBlock
sarahelsaig Aug 7, 2026
fa4647f
Upload MSBuild Binary Log
sarahelsaig Aug 7, 2026
85f1ea7
Write-GitHub
sarahelsaig Aug 8, 2026
a60c65b
Typo
sarahelsaig Aug 9, 2026
d3240c5
Merge branch 'dev' into issue/NEST-608
sarahelsaig Aug 11, 2026
d6e81f2
Add missing Start-Sleep.
sarahelsaig Aug 11, 2026
60dfa4a
Merge remote-tracking branch 'origin/dev' into issue/NEST-608
sarahelsaig Aug 14, 2026
f94e2e7
Add test-orchard-core-url to deploy workflow.
sarahelsaig Aug 15, 2026
8e576fa
Fix syntax.
sarahelsaig Aug 15, 2026
ab99a9d
verifyOrchardCoreDelayTimeSeconds
sarahelsaig Aug 15, 2026
3c27bc8
Add try-catch.
sarahelsaig Aug 15, 2026
89d0522
Fix catch
sarahelsaig Aug 15, 2026
5901782
Prevents background worker processes from staying alive in memory
sarahelsaig Aug 16, 2026
9a1a321
Fix unnecesary escapes.
sarahelsaig Aug 16, 2026
1be8269
Use Write-GitHub.
sarahelsaig Aug 16, 2026
56c4fa4
invert condition
sarahelsaig Aug 16, 2026
1dc92f1
Save artifacts in verify-gha-refs.
sarahelsaig Aug 16, 2026
89f2b3e
Fix initial GHA ref.
sarahelsaig Aug 16, 2026
c325975
Fix errors.
sarahelsaig Aug 16, 2026
7abb512
Need Force to remove "hidden" item.
sarahelsaig Aug 16, 2026
0f3d6a8
Fix refs using artifact.
sarahelsaig Aug 16, 2026
60b647c
Fix refs using artifact.
sarahelsaig Aug 16, 2026
e2efd3b
Fix refs using artifact.
sarahelsaig Aug 16, 2026
7fb30b0
Maybe this is not good.
sarahelsaig Aug 16, 2026
8c30233
publish-show-diagnostics
sarahelsaig Aug 16, 2026
c4be698
Remove leftover code.
sarahelsaig Aug 16, 2026
ad5f3de
Fix missing default.
sarahelsaig Aug 18, 2026
ff9367e
Use ArgumentList.
sarahelsaig Aug 18, 2026
b0d396f
Fix syntax
sarahelsaig Aug 18, 2026
72f1af3
revert build-timeout-minutes
sarahelsaig Aug 18, 2026
00ee2ae
test
sarahelsaig Aug 18, 2026
6d6594b
test
sarahelsaig Aug 18, 2026
a24b199
wat
sarahelsaig Aug 18, 2026
e3adda3
Uniformly use `$LASTEXITCODE` instead of `$?` everywhere.
sarahelsaig Aug 20, 2026
9fcf75c
Add error message.
sarahelsaig Aug 20, 2026
97e6274
Handle if the job fails.
sarahelsaig Aug 20, 2026
256de2b
test
sarahelsaig Aug 20, 2026
7b05fcb
test
sarahelsaig Aug 20, 2026
6b930d2
Stop if the job sent a GHA error message.
sarahelsaig Aug 20, 2026
97e372a
Try using throw.
sarahelsaig Aug 20, 2026
9b92215
throw inside as well
sarahelsaig Aug 20, 2026
66c9a6b
Remove diagnostics.
sarahelsaig Aug 20, 2026
0ee606f
SDK version and globals.json improvement.
sarahelsaig Aug 20, 2026
19b782a
Merge branch 'dev' into issue/NEST-608
sarahelsaig Aug 22, 2026
51f253e
Fix Compress-Archive usage.
sarahelsaig Aug 23, 2026
0130855
Don't break if there is no .agents directory.
sarahelsaig Aug 23, 2026
671999b
Fix PS warnings.
sarahelsaig Aug 23, 2026
a1e0845
Update .github/actions/build-dotnet/action.yml
sarahelsaig Aug 23, 2026
b09b0b4
remove rollForward for now
sarahelsaig Aug 24, 2026
bbbc5e0
Merge branch 'issue/NEST-608' of https://github.com/Lombiq/GitHub-Act…
sarahelsaig Aug 24, 2026
2dd081d
Reverting issue branch references for GHA
Piedone Aug 24, 2026
86dfb16
Trigger CI
Piedone Aug 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $body = ConvertTo-Json $annotation -Compress
# Az CLI and Invoke-AzRestMethod both work in GitHub Actions, but Az throws various (inconsistent) errors in localhost.
Invoke-AzRestMethod -Path "$ApplicationInsightsResourceId/Annotations?api-version=2015-05-01" -Method PUT -Payload $body

if (-not $?)
Comment thread
sarahelsaig marked this conversation as resolved.
if ($LASTEXITCODE -gt 0)
{
exit 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if ($noErrorsExpected)
{
dotnet build $SolutionOrProject @buildSwitches

if (-not $? -and $RebuildDirectory -and (Test-Path -Path $RebuildDirectory))
if (($LASTEXITCODE -eq 0) -and $RebuildDirectory -and (Test-Path -Path $RebuildDirectory))
{
foreach ($project in (Get-ChildItem -Path $RebuildDirectory -Filter *.csproj -Recurse))
{
Expand All @@ -91,8 +91,9 @@ else
}
}

if ($noErrorsExpected -and -not $?)
if ($noErrorsExpected -and ($LASTEXITCODE -gt 0))
{
Write-GitHub "Solution or project build failed with error code $LASTEXITCODE."
exit 1
}

Expand Down
38 changes: 31 additions & 7 deletions .github/actions/build-dotnet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ inputs:
description: >
If a path is provided, C# project files are searched and rebuilt inside that directory. This is to be considered a
workaround for a build order problem, and should be avoided when possible.
timeout-minutes:
required: false
default: '360'
description: >
The maximum time the for the "build" step in minutes. Can be useful in combination with "create-binary-log" if the
build hangs.

runs:
using: composite
Expand Down Expand Up @@ -177,16 +183,18 @@ runs:
shell: pwsh
working-directory: ${{ inputs.directory }}
run: |
$globalJsonExists = Test-Path -Path .\global.json -PathType Leaf
# Read from file or use empty object.
$globalJsonContent = $globalJsonExists ? (Get-Content .\global.json -Raw) : '{}'
$globalJsonObject = $globalJsonContent | ConvertFrom-Json
$globalJsonContent = (Test-Path -Path .\global.json -PathType Leaf) ? (Get-Content .\global.json -Raw) : '{}'
$globalJsonObject = $globalJsonContent | ConvertFrom-Json -AsHashTable

# Only set the sdk property if it does not exist yet.
if (-not (Get-Member -InputObject $globalJsonObject -Name 'sdk' -MemberType NoteProperty))
if (-not $globalJsonObject.ContainsKey('sdk'))
{
$sdkValue = "{ ""version"": ""$Env:DOTNET_SDK_TO_USE"" }" | ConvertFrom-Json
Add-Member -InputObject $globalJsonObject -MemberType NoteProperty -Name 'sdk' -Value $sdkValue
$globalJsonObject['sdk'] = @{
"version" = $Env:DOTNET_SDK_TO_USE
}
}

# Write back to file.
$globalJsonObject | ConvertTo-Json | Set-Content .\global.json

Expand All @@ -212,6 +220,18 @@ runs:
$solutionOrProjectPathInput = '${{ inputs.solution-or-project-path }}'
$solutionOrProjectPath = $solutionOrProjectPathInput ? (Get-SolutionOrProjectPath $solutionOrProjectPathInput) : ''

$block = {
$ErrorActionPreference = 'Stop'
$buildSwitches = $args[0]

Build-DotNetSolutionOrProject @buildSwitches

if ($LASTEXITCODE -gt 0)
{
throw "Build failed with exit code $LASTEXITCODE."
}
}

$switches = @{
Configuration = "${{ inputs.configuration }}"
SolutionOrProject = $solutionOrProjectPath
Expand All @@ -226,7 +246,11 @@ runs:
}

$startTime = [DateTime]::Now
Build-DotNetSolutionOrProject @switches
Invoke-ScriptBlock `
-TimeoutMinutes ${{ inputs.timeout-minutes }} `
-Name 'Build-DotNetSolutionOrProject' `
-ScriptBlock $block `
-ArgumentList $switches
$endTime = [DateTime]::Now

Write-Output ("Solution or project build took {0:0.###} seconds." -f ($endTime - $startTime).TotalSeconds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ msbuild $SolutionOrProject @buildSwitches
# Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET
# Framework Developer Packs at https://aka.ms/msbuild/developerpacks

if ($?)
if ($LASTEXITCODE -eq 0)
{
Write-Output 'Build successful.'
Stop-DotNetBuildServers
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-dotnet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Sets up the .NET SDK.
inputs:
dotnet-version:
required: false
default: 10.0.102
default: 10.0.302
Comment thread
Piedone marked this conversation as resolved.
description: Version of the .NET SDK to set up.

runs:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-sql-server/Wait-SqlServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ for ($i = 1; $i -le $maxTryCount; $i++)
sqlcmd -C -b -U sa -P 'Password1!' -Q 'SELECT @@SERVERNAME as ServerName' 2>&1>$null
}

if ($?)
if ($LASTEXITCODE -eq 0)
{
Write-Output 'SQL Server is successfully started.'
exit 0
Expand Down
20 changes: 0 additions & 20 deletions .github/actions/test-dotnet/Invoke-SolutionOrProjectTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,6 @@ param (
[boolean] $EnableDiagnosticMode,
[boolean] $ShowTimeRemainingUntilTimeout)

function Write-GitHub
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingWriteHost',
'',
Justification = 'These messages github annotations always have to go to the workflow runner virtual console.')]
param(
[Parameter(Mandatory = $true, Position = 0)]
[string] $Message,
[switch] $Warning,
[switch] $Notice)

$mode = 'error'

if ($Warning) { $mode = 'warning' }
if ($Notice) { $mode = 'notice' }

Write-Host "::$mode::$Message"
}

# This is a magic variable, setting it lets us always display the information stream without needing to add the
# "-InformationAction Continue" to every call. This is not best practice for general PowerShell scripts, but makes sense
# for scripts made for GHA.
Expand Down
56 changes: 39 additions & 17 deletions .github/actions/verify-gha-refs/Check-Called-GHA-Refs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,40 @@
[String] $GitHubRefName
)

$first = $true
$files = @()

if ($CalledRepoBaseIncludeList.Count -eq 0)
{
Write-Output '::warning file=Check-Called-GHA-refs.ps1,line10::CalledRepoBaseIncludeList is empty which is unexpected. If this was intentional, you can ignore this warning.'
Write-GitHub -Warning 'Check-Called-GHA-refs.ps1: CalledRepoBaseIncludeList is empty which is unexpected. If this was intentional, you can ignore this warning.'
exit 0 # Nothing to check because array is empty.
}

$CalledRepoBaseIncludeList = $CalledRepoBaseIncludeList.ForEach({ 'uses:\s*' + $PSItem })

$mismatchRefs = @(Get-ChildItem -Path $PathIncludeList -Include $FileIncludeList -Force -Recurse) |
Select-String -Pattern $CalledRepoBaseIncludeList |
Select-String -Pattern $ExpectedRef -NotMatch

if ($mismatchRefs.Count -gt 0)
while ($true)
{
Write-Output '> :warning: Warning :warning:' >> $env:GITHUB_STEP_SUMMARY
Write-Output '> Your pull request branch may be outdated if you see errors for files you did not edit. Please merge the target branch to resolve these errors.' >> $env:GITHUB_STEP_SUMMARY
$mismatchRefs = @(Get-ChildItem -Path $PathIncludeList -Include $FileIncludeList -Force -Recurse) |
Select-String -Pattern $CalledRepoBaseIncludeList |
Select-String -Pattern $ExpectedRef -NotMatch

if ($mismatchRefs.Count -eq 0)
{
break
}

if ($first)
{
Set-GitHubOutput 'has-files' 'true'

Write-Output '' >> $env:GITHUB_STEP_SUMMARY
Write-Output '> :warning: Warning :warning:' >> $env:GITHUB_STEP_SUMMARY
Write-Output '> Your pull request branch may be outdated if you see errors for files you did not edit. Please merge the target branch to resolve these errors.' >> $env:GITHUB_STEP_SUMMARY

"These called GitHub Actions and Workflows do not match expected ref '$ExpectedRef'." >> $env:GITHUB_STEP_SUMMARY
Write-Output '' >> $env:GITHUB_STEP_SUMMARY

"These called GitHub Actions and Workflows do not match expected ref '$ExpectedRef'." >> $env:GITHUB_STEP_SUMMARY
$first = $false
}

foreach ($mismatch in $mismatchRefs)
{
Expand All @@ -41,14 +55,22 @@ if ($mismatchRefs.Count -gt 0)
# As a workaround, link directly to file.
"- <a href='https://github.com/$GitHubRepository/blob/$GitHubRefName/$filename#L$lineNumber'>$filename#L$lineNumber</a>" >> $env:GITHUB_STEP_SUMMARY
# And write better log message.
Write-Output "::error::$filename#L$lineNumber - called GitHub Action does not match expected Ref '$ExpectedRef'."
Write-GitHub "$filename#L$lineNumber - called GitHub Action does not match expected Ref '$ExpectedRef'."

'```yaml' >> $env:GITHUB_STEP_SUMMARY
$title >> $env:GITHUB_STEP_SUMMARY
'```' >> $env:GITHUB_STEP_SUMMARY

# Beware the backtick character is the powershell escape character.
"``````yaml" >> $env:GITHUB_STEP_SUMMARY
"$title" >> $env:GITHUB_STEP_SUMMARY
"``````" >> $env:GITHUB_STEP_SUMMARY
$targetLine = $mismatch.Line -replace '@.*', "@$ExpectedRef"
$content = Get-Content $filename
$content.Replace($mismatch.Line, $targetLine) > $filename

$files += $filename
}
}

Write-Output "::error::Check Job Summary for more details on which GitHub Actions Refs do not match '$ExpectedRef'."
exit 1
if ($files.Count -gt 0)
{
"Check Job Summary for more details on which GitHub Actions Refs do not match '$ExpectedRef'." > .gha-error
Set-GitHubOutput 'artifact-path' (($files | Select-Object -Unique) -join [Environment]::NewLine)
}
33 changes: 33 additions & 0 deletions .github/actions/verify-gha-refs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,22 @@ inputs:
required: false
default: ${{ github.ref_name }}
description: The expected reference value to be used by the called GHA Workflows and Actions.
artifact-retention-days:
required: false
default: '1'
description: >
Duration in days after which the artifact of the pending changed files (if any) will expire. See
https://github.com/actions/upload-artifact#retention-period for more details.
runs:
using: composite
steps:
- name: Setup
id: setup
shell: pwsh
run: |
'${{ github.action_path }}' >> $Env:GITHUB_PATH
(Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH
Initialize-ArtifactNameSuffix '.'

- name: Check References
id: check-references
Expand All @@ -47,3 +56,27 @@ runs:
GitHubRefName = "${{ inputs.expected-ref }}"
}
Check-Called-GHA-Refs @params

- name: Upload Files Causing Failure
if: steps.check-references.outputs.has-files == 'true'
uses: Lombiq/GitHub-Actions/.github/actions/upload-artifact@dev
with:
name: check-references-fixes-${{ steps.setup.outputs.artifact-name-suffix }}
path: ${{ steps.check-references.outputs.artifact-path }}
if-no-files-found: ignore
retention-days: ${{ inputs.artifact-retention-days }}

- name: Fail if flagged
shell: pwsh
run: |
if (-not (Test-Path .gha-error))
{
Write-Output "Verify GitHub Actions References completed successfully."
exit 0
}

$ghaError = ((Get-Content .gha-error).Replace("`n", ' ') -join ' ') -replace '\s+', ' '
Write-GitHub "Verify GitHub Actions References failed with the following error: $ghaError"

Remove-Item -Force .gha-error
exit 1
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ on:
that the runner has insufficient storage space.
dotnet-version:
type: string
default: 10.0.102
default: 10.0.302
description: Version of the .NET SDK to set up.
node-version:
type: string
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-and-test-orchard-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ on:
that the runner has insufficient storage space.
dotnet-version:
type: string
default: 10.0.102
default: 10.0.302
description: Version of the .NET SDK to set up.
node-version:
type: string
Expand Down Expand Up @@ -157,6 +157,12 @@ on:
description: >
If a path is provided, C# project files are searched and rebuilt inside that directory. This is to be
considered a workaround for a build order problem, and should be avoided when possible.
build-timeout-minutes:
type: number
default: 360
description: >
The maximum time the for the "build-dotnet" action's "build" step in minutes. Can be useful in combination
with "build-create-binary-log" if the build hangs.
dotnet-test-process-timeout:
required: false
type: number
Expand Down Expand Up @@ -373,6 +379,7 @@ jobs:
dotnet-clean: ${{ case(inputs.build-configuration == inputs.test-configuration, 'false', 'true') }}
git-clean: ${{ case(inputs.build-configuration == inputs.test-configuration, 'false', 'true') }}
rebuild-directory: ${{ inputs.build-rebuild-directory }}
timeout-minutes: ${{ inputs.build-timeout-minutes }}

- name: Verify Git Status is Clean
if: inputs.build-fail-on-pending-changes == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
'["ubuntu-24.04"]' or '["ubuntu-24.04", "windows-2025"]'.
dotnet-version:
type: string
default: 10.0.102
default: 10.0.302
description: Version of the .NET SDK to set up.
build-directory:
type: string
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-orchard1-to-azure-app-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ on:
that the runner has insufficient storage space.
dotnet-version:
type: string
default: 10.0.102
default: 10.0.302
description: Version of the .NET SDK to set up.
node-version:
type: string
Expand Down
Loading