Skip to content

Commit

Permalink
add shared-configurations-token option
Browse files Browse the repository at this point in the history
  • Loading branch information
narwold committed Apr 11, 2023
1 parent 559d6d8 commit b2c61c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const uniq = (arr) => [...new Set(arr)];
async function run() {
try {
const token = core.getInput("repo-token", { required: true });
const sharedConfigsToken = core.getInput("shared-configurations-token", { required: false }) || token;
const configPath = core.getInput("configuration-path", { required: true });
const sharedConfigurations = JSON.parse(
core.getInput("shared-configurations", {
Expand All @@ -36,6 +37,7 @@ async function run() {
}

const client = new github.GitHub(token);
const sharedConfigsClient = new github.GitHub(sharedConfigsToken);

const { data: pullRequest } = await client.pulls.get({
owner: github.context.repo.owner,
Expand All @@ -58,7 +60,7 @@ async function run() {
/([^/]+)\/([^/]+)\/?(.*)?@/
);
const [, repoRef] = config.match("@(.*)");
return getLabelGlobs(client, repoPath, {
return getLabelGlobs(sharedConfigsClient, repoPath, {
repoOwner,
repoName,
repoRef,
Expand Down

0 comments on commit b2c61c8

Please sign in to comment.