Skip to content

Commit 6f4a539

Browse files
amol-raulcd
andauthored
MINOR: Setup linking between PR and Issue in GitHub (apache#14783)
Lead-authored-by: Alessandro Molina <amol@turbogears.org> Co-authored-by: Raúl Cumplido <raulcumplido@gmail.com> Signed-off-by: Alessandro Molina <amol@turbogears.org>
1 parent df07b91 commit 6f4a539

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎.github/workflows/dev_pr/link.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,17 @@ async function commentJIRAURL(github, context, pullRequestNumber, jiraID) {
8282
async function commentGitHubURL(github, context, pullRequestNumber, issueID) {
8383
// Make the call to ensure issue exists before adding comment
8484
const issueInfo = await helpers.getGitHubInfo(github, context, issueID, pullRequestNumber);
85-
const message = "* Github Issue: #" + issueInfo.number
85+
const message = "* Closes: #" + issueInfo.number
8686
if (await haveComment(github, context, pullRequestNumber, message)) {
8787
return;
8888
}
8989
if (issueInfo){
90+
await github.pulls.update({
91+
owner: context.repo.owner,
92+
repo: context.repo.repo,
93+
pull_number: pullRequestNumber,
94+
body: (context.payload.pull_request.body || "") + "\n" + message
95+
});
9096
await github.issues.createComment({
9197
owner: context.repo.owner,
9298
repo: context.repo.repo,

0 commit comments

Comments
 (0)