Skip to content

Commit 205d1fb

Browse files
authored
Merge pull request #58 from xangxiong/getperm-patch
fix: [1618] query only repo matching uuid and role to properly suppor…
2 parents de8591f + 9071dcf commit 205d1fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class BitbucketScm extends Scm {
568568

569569
const getPerm = async (desiredAccess) => {
570570
const options = {
571-
url: `${API_URL_V2}/repositories/${owner}`,
571+
url: `${API_URL_V2}/repositories/${owner}?q=uuid%3D%22${uuid}%22`,
572572
method: 'GET',
573573
json: true,
574574
auth: {
@@ -577,9 +577,9 @@ class BitbucketScm extends Scm {
577577
};
578578

579579
if (desiredAccess === 'admin') {
580-
options.url = `${options.url}?role=admin`;
580+
options.url = `${options.url}&role=admin`;
581581
} else if (desiredAccess === 'push') {
582-
options.url = `${options.url}?role=contributor`;
582+
options.url = `${options.url}&role=contributor`;
583583
} else {
584584
options.url = `${options.url}`;
585585
}

0 commit comments

Comments
 (0)