File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -51,15 +51,14 @@ if (($warnings -gt 0) -or ($infos -gt 0)) {
5151}
5252Write-Output $comment
5353
54- # Comment threshold
55-
54+ $ghEvent = Get-Content - Path $ env: GITHUB_EVENT_PATH | ConvertFrom-Json
55+ $commentsUrl = $ghEvent .pull_request.comments_url
5656
5757# Send comment back to PR if any errors were found
58- if ($env: PSSCRIPTANALYZER_SEND_COMMENT -ne ' false' -and $env: PSSCRIPTANALYZER_SEND_COMMENT -ne 0 ) {
58+ if ($env: PSSCRIPTANALYZER_SEND_COMMENT -ne ' false' -and $env: PSSCRIPTANALYZER_SEND_COMMENT -ne 0 -and $commentsUrl ) {
5959 if ($errors -gt 0 ) {
60- $ghEvent = Get-Content - Path $env: GITHUB_EVENT_PATH | ConvertFrom-Json
6160 $params = @ {
62- Uri = $ghEvent .pull_request . ' _links ' .comments.href
61+ Uri = $commentsUrl
6362 Method = ' Post'
6463 Headers = @ {
6564 Authorization = " token $env: GITHUB_TOKEN "
You can’t perform that action at this time.
0 commit comments