This repository was archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
This repository was archived by the owner on Sep 11, 2023. It is now read-only.
Create Comment on PR in different Repo fails with error #19
Copy link
Copy link
Open
Labels
@task/PullRequestCommentsIssues related to the PullRequestComments taskIssues related to the PullRequestComments task
Description
I want to update an PR as part of a build triggered by a Pull request.
The definition for the pipeline is a different repository then the PR which triggered the build.
This throws an error:
Task : Pull Request Comments
Description : Add comments to a pull request
Version : 0.4.1
Author : Joachim Dalen
Help : https://devops-extensions.dev/docs/extensions/pull-request-utils/tasks/pull-request-comments
==============================================================================
##[debug]Using node path: /home/vsts/agents/2.217.2/externals/node10/bin/node
##[debug]agent.TempDirectory=/home/vsts/work/_temp
##[debug]loading inputs and endpoints
##[debug]loading INPUT_ACTION
##[debug]loading INPUT_SKIPIFCOMMENTEXISTS
##[debug]loading INPUT_COMMENTID
##[debug]loading INPUT_STATUS
##[debug]loading INPUT_CONTENT
##[debug]loading INPUT_USEDEFINED
##[debug]loading INPUT_PULLREQUESTID
##[debug]loading INPUT_TYPE
##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
##[debug]loaded 12
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]System.AccessToken=***
##[debug]System.TeamFoundationCollectionUri=https://dev.azure.com/xxx/
##[debug]Build.Repository.ID=70d68496-6a91-4137-a7a2-b64d01e5694e
##[debug]useDefined=false
##[debug]System.PullRequest.PullRequestId=362800
##[debug]content=This is a comment posted from pipeline CI_Ansible-lint
##[debug]skipIfCommentExists=true
##[debug]action=createOrUpdate
##[debug]type=Text
##[debug]task result: Failed
##[error]e is not iterable
##[debug]Processed: ##vso[task.issue type=error;]e is not iterable
##[debug]Processed: ##vso[task.complete result=Failed;]e is not iterable
Finishing: Post markdown comment
This is caused by following code line I think:
azdevops-pull-request-utils/tasks/pull-request-comments/src/operations/PullRequestManager.ts
Line 19 in 95a4cc6
| const repositoryId = tl.getVariable('Build.Repository.ID'); |
Either it should be possible to specify a different repo as a parameter, or the extension should use the pull request source repository if the build is triggered by a PR.
Metadata
Metadata
Assignees
Labels
@task/PullRequestCommentsIssues related to the PullRequestComments taskIssues related to the PullRequestComments task