Skip to content

Commit 4f7d401

Browse files
committed
be sneakier about PR numbers in commit messages in bump omicron PR
1 parent af6536d commit 4f7d401

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎tools/deno/bump-omicron.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,17 @@ function getUploadAssetsWorkflowId() {
6565
*/
6666
function linkifyGitLog(line: string): string {
6767
const sha = line.slice(2, 10)
68-
const rest = line.slice(11).replace(/#\d+/g, (s) => 'oxidecomputer/console' + s)
68+
let rest = line.slice(11)
69+
70+
// if the test ends with '(#123)', make the number the whole text, otherwise
71+
// it's redundant when it renders in the PR
72+
const endsWithPr = rest.match(/\(#\d+\)$/)
73+
if (endsWithPr) {
74+
rest = endsWithPr[0].replace(/[()]/g, '')
75+
}
76+
77+
rest = rest.replace(/#\d+/g, (s) => 'oxidecomputer/console' + s)
78+
6979
const shaLink = `[${sha}](https://github.com/oxidecomputer/console/commit/${sha})`
7080

7181
return `* ${shaLink} ${rest}`

0 commit comments

Comments
 (0)