Skip to content
This repository was archived by the owner on Jul 15, 2026. It is now read-only.
Merged
Changes from all commits
Commits
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
13 changes: 10 additions & 3 deletions eng/common/scripts/Helpers/ApiView-Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ function Set-ApiViewCommentForRelatedIssues {
[string]$APIViewHost = "https://apiview.dev",
[ValidateNotNullOrEmpty()]
[Parameter(Mandatory = $true)]
$AuthToken
$AuthToken,
[string]$GitHubActionRunUrl = ""
)
. ${PSScriptRoot}\..\common.ps1
$issuesForCommit = $null
Expand All @@ -144,7 +145,7 @@ function Set-ApiViewCommentForRelatedIssues {
}
$issuesForCommit.items | ForEach-Object {
$urlParts = $_.url -split "/"
Set-ApiViewCommentForPR -RepoOwner $urlParts[4] -RepoName $urlParts[5] -PrNumber $urlParts[7] -HeadCommitish $HeadCommitish -APIViewHost $APIViewHost -AuthToken $AuthToken
Set-ApiViewCommentForPR -RepoOwner $urlParts[4] -RepoName $urlParts[5] -PrNumber $urlParts[7] -HeadCommitish $HeadCommitish -APIViewHost $APIViewHost -AuthToken $AuthToken -GitHubActionRunUrl $GitHubActionRunUrl
}
}

Expand All @@ -162,7 +163,8 @@ function Set-ApiViewCommentForPR {
[string]$APIViewHost,
[ValidateNotNullOrEmpty()]
[Parameter(Mandatory = $true)]
$AuthToken
$AuthToken,
[string]$GitHubActionRunUrl = ""
)
$repoFullName = "$RepoOwner/$RepoName"
$apiviewEndpoint = "$APIViewHost/api/pullrequests?pullRequestNumber=$PrNumber&repoName=$repoFullName&commitSHA=$HeadCommitish"
Expand Down Expand Up @@ -208,6 +210,11 @@ function Set-ApiViewCommentForPR {
}

$commentText += "<!-- Fetch URI: $apiviewEndpoint -->"
if (-not [string]::IsNullOrWhiteSpace($GitHubActionRunUrl)) {
$commentText += ""
$commentText += "---"
$commentText += "Comment generated by [After APIView]($GitHubActionRunUrl) workflow run."
}
$commentText = $commentText -join "`r`n"
$existingComment = $null;
$existingAPIViewComment = $null;
Expand Down
Loading