Browse Source

Add autolink for PRs

main
mamolin 3 years ago
committed by Eric Amodio
parent
commit
af81cd496b
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      src/git/remotes/azure-devops.ts

+ 8
- 2
src/git/remotes/azure-devops.ts View File

@ -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/<num>`,
url: `${workUrl}/_workitems/edit/<num>`,
title: `Open Work Item #<num> 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/<num>`,
title: `Open Pull Request #<num> on ${this.name}`,
},
];
}
return this._autolinks;

Loading…
Cancel
Save