Skip to content

Commit 37eb631

Browse files
author
Github Actions
committed
Update dotnet.yml workflow to ensure WorkspacePath is correctly set and enhance Write-InformationStream function to support pipeline input for Object parameter. This improves the flexibility of the logging function and maintains consistency in the CI/CD process.
1 parent e0d2b54 commit 37eb631

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ jobs:
6666
-GitSha "${{ github.sha }}" `
6767
-GitHubOwner "${{ github.repository_owner }}" `
6868
-GitHubRepo "${{ github.repository }}" `
69-
-WorkspacePath "${{ github.workspace }}" `
7069
-GithubToken "${{ github.token }}" `
7170
-NuGetApiKey "${{ secrets.NUGET_KEY }}" `
71+
-WorkspacePath "${{ github.workspace }}" `
7272
-ExpectedOwner "ktsu-dev" `
7373
-ChangelogFile "CHANGELOG.md" `
7474
-AssetPatterns @("staging/*.nupkg", "staging/*.zip")

scripts/PSBuild.psm1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,16 +1521,18 @@ function Write-InformationStream {
15211521
#>
15221522
[CmdletBinding()]
15231523
param (
1524-
[Parameter(Mandatory=$true)]
1524+
[Parameter(ValueFromPipeline=$true, ParameterSetName="Object")]
15251525
[object]$Object,
15261526
[Parameter()]
15271527
[AllowEmptyCollection()]
15281528
[string[]]$Tags = @("Write-InformationStream")
15291529
)
15301530

1531-
# Use array subexpression to ensure consistent collection handling
1532-
$Object | ForEach-Object {
1533-
Write-Information $_ -Tags $Tags
1531+
process {
1532+
# Use array subexpression to ensure consistent collection handling
1533+
$Object | ForEach-Object {
1534+
Write-Information $_ -Tags $Tags
1535+
}
15341536
}
15351537
}
15361538

@@ -1576,9 +1578,6 @@ function Invoke-ExpressionWithLogging {
15761578
}
15771579

15781580
if ($ScriptBlock) {
1579-
# Display the expression
1580-
Write-Information -MessageData $ScriptBlock -Tags $Tags
1581-
15821581
# Execute the expression and return its result
15831582
& $ScriptBlock | ForEach-Object {
15841583
Write-Output $_

0 commit comments

Comments
 (0)