diff --git a/lib/workers/pr.js b/lib/workers/pr.js index f905df180edc442d3519ad6cddd8a89a262e9a11..5b019e2f61b8bd4f81fd160230535c4ec209f61a 100644 --- a/lib/workers/pr.js +++ b/lib/workers/pr.js @@ -66,6 +66,11 @@ async function ensurePr(upgrades) { commit.url = `${logJSON.project.repository}/commit/${change.sha}`; if (change.message) { commit.message = change.message.split('\n')[0]; + const re = /([\s(])#(\d+)([)\s]?)/g; + commit.message = commit.message.replace( + re, + `$1[#$2](${upgrade.repositoryUrl}/issues/$2)$3` + ); } release.commits.push(commit); }); diff --git a/test/workers/pr.spec.js b/test/workers/pr.spec.js index c183da0850f0f00aec0ebebaa622d5fa0b96ceaa..1432f26917236d7b76a648f8115c912f84a966c3 100644 --- a/test/workers/pr.spec.js +++ b/test/workers/pr.spec.js @@ -22,7 +22,7 @@ changelogHelper.getChangeLogJSON.mockReturnValue({ { date: new Date('2017-01-01'), sha: 'abcdefghijklmnopqrstuvwxyz', - message: 'foo\nbar', + message: 'foo #3\nbar', }, ], }, @@ -96,7 +96,7 @@ describe('workers/pr', () => { <summary>renovateapp/dummy</summary> #### 1.1.0 -- [\`abcdefg\`](https://github.com/renovateapp/dummy/commit/abcdefghijklmnopqrstuvwxyz)foo +- [\`abcdefg\`](https://github.com/renovateapp/dummy/commit/abcdefghijklmnopqrstuvwxyz)foo [#3](https://github.com/renovateapp/dummy/issues/3) </details>