Skip to content

Commit e2ecae2

Browse files
Updated check for new PAT format (#8985)
1 parent e82238a commit e2ecae2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

coe-cli/src/commands/devops.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,7 @@ class DevOpsCommand {
12061206
}
12071207

12081208
async getGitCommitChanges(args: DevOpsBranchArguments, gitApi: gitm.IGitApi, projectRepo: GitRepository, pipelineRepo: GitRepository, sourceBranch: string, destinationBranch: string, defaultBranch: string, names: string[]): Promise<GitChange[]> {
1209+
const personalAccessTokenRegexp = /^.{76}AZDO.{4}$/;
12091210
let pipelineProject = args.pipelineProject?.length > 0 ? args.pipelineProject : args.projectName
12101211
let results: GitChange[] = []
12111212

@@ -1215,7 +1216,7 @@ class DevOpsCommand {
12151216
'Authorization': `Bearer ${accessToken}`
12161217
}
12171218
}
1218-
if (accessToken.length === 52) {
1219+
if (accessToken.length === 52 || personalAccessTokenRegexp.test(accessToken)) {
12191220
config = {
12201221
headers: {
12211222
'Authorization': `Basic ${Buffer.from(":" + accessToken).toString('base64')}`

0 commit comments

Comments
 (0)