Skip to content

Commit 822b1c2

Browse files
authored
feat: provide scope as parameter (#28)
<!-- 👋 Hi, thanks for sending a PR to azdo-npm-auth! 💖. Please fill out all fields below and make sure each item is true and [x] checked. Otherwise we may not be able to review your PR. --> ## PR Checklist - [x] Addresses an existing open issue: fixes #27 - [x] That issue was marked as [`status: accepting prs`](https://github.com/johnnyreilly/azdo-npm-auth/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/johnnyreilly/azdo-npm-auth/blob/main/.github/CONTRIBUTING.md) were taken ## Overview <!-- Description of what is changed and how the code change does that. --> See linked issue
1 parent 75f1dac commit 822b1c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/createPat.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ export async function createPat({
1111
logger = fallbackLogger,
1212
organisation,
1313
daysToExpiry,
14+
scope = "vso.packaging",
1415
}: {
1516
logger?: Logger;
1617
organisation: string;
1718
daysToExpiry?: number;
19+
scope?: string;
1820
}): Promise<TokenResult> {
1921
// const credential = new InteractiveBrowserCredential({});
2022
logger.info(`Creating Azure CLI Token`);
@@ -39,7 +41,7 @@ export async function createPat({
3941
const url = `https://vssps.dev.azure.com/${organisation}/_apis/tokens/pats?api-version=7.1-preview.1`;
4042
const data = {
4143
displayName: `made by azdo-npm-auth at: ${new Date().toISOString()}`,
42-
scope: "vso.packaging",
44+
scope,
4345
allOrgs: false,
4446
...(validTo && { validTo: validTo.toISOString() }),
4547
};

0 commit comments

Comments
 (0)