From af81cd496bcfadb094b0cb6d679fe9cede2cc8d7 Mon Sep 17 00:00:00 2001 From: mamolin Date: Thu, 29 Apr 2021 11:03:42 -0700 Subject: [PATCH] Add autolink for PRs --- src/git/remotes/azure-devops.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/git/remotes/azure-devops.ts b/src/git/remotes/azure-devops.ts index 93781da..90cd149 100644 --- a/src/git/remotes/azure-devops.ts +++ b/src/git/remotes/azure-devops.ts @@ -46,13 +46,19 @@ export class AzureDevOpsRemote extends RemoteProvider { override get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] { if (this._autolinks === undefined) { // Strip off any `_git` part from the repo url - const baseUrl = this.baseUrl.replace(gitRegex, '/'); + const workUrl = this.baseUrl.replace(gitRegex, '/'); this._autolinks = [ { prefix: '#', - url: `${baseUrl}/_workitems/edit/`, + url: `${workUrl}/_workitems/edit/`, title: `Open Work Item # on ${this.name}`, }, + { + // Default Pull request message when merging a PR in ADO. Will not catch commits & pushes following a different pattern. + prefix: 'Merged PR ', + url: `${this.baseUrl}/pullrequest/`, + title: `Open Pull Request # on ${this.name}`, + }, ]; } return this._autolinks;