Skip to content

Commit

Permalink
Add helpers to log a GitHub "notice" (#38574)
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Harder <[email protected]>
  • Loading branch information
azure-sdk and mikeharder authored Nov 16, 2024
1 parent 7b7a042 commit 23cdc6b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions eng/common/scripts/logging.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@ function LogInfo {
Write-Host "$args"
}

function LogNotice {
if (Test-SupportsGitHubLogging) {
Write-Host ("::notice::$args" -replace "`n", "%0D%0A")
}
else {
# No equivalent for DevOps
Write-Host "[Notice] $args"
}
}

function LogNoticeForFile($file, $noticeString) {
if (Test-SupportsGitHubLogging) {
Write-Host ("::notice file=$file,line=1,col=1::$noticeString" -replace "`n", "%0D%0A")
}
else {
# No equivalent for DevOps
Write-Host "[Notice in file $file] $noticeString"
}
}

function LogWarning {
if (Test-SupportsDevOpsLogging) {
Write-Host ("##vso[task.LogIssue type=warning;]$args" -replace "`n", "%0D%0A")
Expand Down

0 comments on commit 23cdc6b

Please sign in to comment.