diff --git a/.github/workflows/dev_pr/link.js b/.github/workflows/dev_pr/link.js index 1fbd0447175bd..05e6a85a8774e 100644 --- a/.github/workflows/dev_pr/link.js +++ b/.github/workflows/dev_pr/link.js @@ -83,22 +83,16 @@ async function commentGitHubURL(github, context, pullRequestNumber, issueID) { // Make the call to ensure issue exists before adding comment const issueInfo = await helpers.getGitHubInfo(github, context, issueID, pullRequestNumber); const message = "* Closes: #" + issueInfo.number - if (await haveComment(github, context, pullRequestNumber, message)) { - return; - } - if (issueInfo){ + if (issueInfo) { + if (context.payload.pull_request.body.includes(message)) { + return; + } await github.pulls.update({ owner: context.repo.owner, repo: context.repo.repo, pull_number: pullRequestNumber, body: (context.payload.pull_request.body || "") + "\n" + message }); - await github.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pullRequestNumber, - body: message - }); } }