@firestartr/cli 1.39.6 → 1.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js
CHANGED
@@ -277886,6 +277886,8 @@ var envVars;
|
|
277886
277886
|
envVars["githubAppInstallationId"] = "GITHUB_APP_INSTALLATION_ID";
|
277887
277887
|
envVars["githubAppInstallationIdPrefapp"] = "GITHUB_APP_INSTALLATION_ID_PREFAPP";
|
277888
277888
|
envVars["githubAppPemFile"] = "GITHUB_APP_PEM_FILE";
|
277889
|
+
// ---- PREFAPP BOT VARIABLES -----------------------------------------------
|
277890
|
+
envVars["githubAppPatPrefapp"] = "PREFAPP_BOT_PAT";
|
277889
277891
|
// ---- GENERAL CLI VARIABLES -----------------------------------------------
|
277890
277892
|
envVars["firestartrImageKind"] = "FIRESTARTR_IMAGE_KIND";
|
277891
277893
|
// ---- OPERATOR VARIABLES -----------------------------------------------
|
@@ -283245,9 +283247,9 @@ async function getGithubAppToken(org = 'default', genGithubAppToken = generateGi
|
|
283245
283247
|
return token;
|
283246
283248
|
}
|
283247
283249
|
async function getOctokitForOrg(org = 'default', paginated = false, genGithubAppToken = generateGithubAppToken) {
|
283248
|
-
|
283249
|
-
|
283250
|
-
|
283250
|
+
if (org === 'prefapp')
|
283251
|
+
return getOctokitFromPat(catalog_common.types.envVars.githubAppPatPrefapp);
|
283252
|
+
const installationOrgId = catalog_common.environment.getFromEnvironment(catalog_common.types.envVars.githubAppInstallationId);
|
283251
283253
|
const auth = await genGithubAppToken({
|
283252
283254
|
appId: catalog_common.environment.getFromEnvironment(catalog_common.types.envVars.githubAppId),
|
283253
283255
|
privateKey: catalog_common.environment.getFromEnvironment(catalog_common.types.envVars.githubAppPemFile),
|
@@ -283259,6 +283261,11 @@ async function getOctokitForOrg(org = 'default', paginated = false, genGithubApp
|
|
283259
283261
|
}
|
283260
283262
|
return new dist_src_Octokit(options);
|
283261
283263
|
}
|
283264
|
+
async function getOctokitFromPat(envVar) {
|
283265
|
+
return new dist_src_Octokit({
|
283266
|
+
auth: process.env[envVar],
|
283267
|
+
});
|
283268
|
+
}
|
283262
283269
|
/* harmony default export */ const src_auth = ({ getOctokitForOrg });
|
283263
283270
|
|
283264
283271
|
;// CONCATENATED MODULE: ../github/src/organization.ts
|
@@ -283871,6 +283878,7 @@ async function createOrphanBranch(repo, branch, owner = 'prefapp') {
|
|
283871
283878
|
team: team,
|
283872
283879
|
user: user,
|
283873
283880
|
getOctokitForOrg: getOctokitForOrg,
|
283881
|
+
getOctokitFromPat: getOctokitFromPat,
|
283874
283882
|
generateGithubAppToken: generateGithubAppToken,
|
283875
283883
|
getGithubAppToken: getGithubAppToken,
|
283876
283884
|
auth: src_auth,
|
@@ -288871,7 +288879,10 @@ async function downloadFeatureTarball(repo, featureName, version, owner = 'prefa
|
|
288871
288879
|
if (!release)
|
288872
288880
|
throw new Error(`Release ${featureName}-v${version} not found`);
|
288873
288881
|
const ref = release['tag_name'];
|
288874
|
-
|
288882
|
+
// Only use pat if the owner is prefapp
|
288883
|
+
const octokit = owner === 'prefapp'
|
288884
|
+
? await github_0.getOctokitFromPat('PREFAPP_BOT_PAT')
|
288885
|
+
: await github_0.getOctokitForOrg(owner);
|
288875
288886
|
const response = await octokit.request(`GET /repos/${owner}/${repo}/tarball/${ref}`, { owner, repo, ref });
|
288876
288887
|
const tarballExtractPath = catalog_common.features.tarballs.getFeaturesExtractPath(featureName, version, { createIfNotExists: true });
|
288877
288888
|
const tarballPath = catalog_common.features.tarballs.getFeatureTarballDownloadPath(featureName, version);
|
@@ -34,6 +34,7 @@ export declare enum envVars {
|
|
34
34
|
githubAppInstallationId = "GITHUB_APP_INSTALLATION_ID",
|
35
35
|
githubAppInstallationIdPrefapp = "GITHUB_APP_INSTALLATION_ID_PREFAPP",
|
36
36
|
githubAppPemFile = "GITHUB_APP_PEM_FILE",
|
37
|
+
githubAppPatPrefapp = "PREFAPP_BOT_PAT",
|
37
38
|
firestartrImageKind = "FIRESTARTR_IMAGE_KIND",
|
38
39
|
operatorNamespace = "OPERATOR_NAMESPACE",
|
39
40
|
operatorKindList = "OPERATOR_KIND_LIST",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { getOctokitForOrg, getGithubAppToken } from './src/auth';
|
1
|
+
import { getOctokitForOrg, getGithubAppToken, getOctokitFromPat } from './src/auth';
|
2
2
|
declare const _default: {
|
3
3
|
org: {
|
4
4
|
getRepositoryList: typeof import("./src/organization").getRepositoryList;
|
@@ -37,6 +37,7 @@ declare const _default: {
|
|
37
37
|
getUserInfo: typeof import("./src/user").getUserInfo;
|
38
38
|
};
|
39
39
|
getOctokitForOrg: typeof getOctokitForOrg;
|
40
|
+
getOctokitFromPat: typeof getOctokitFromPat;
|
40
41
|
generateGithubAppToken: (config: any) => Promise<string>;
|
41
42
|
getGithubAppToken: typeof getGithubAppToken;
|
42
43
|
auth: {
|
@@ -2,6 +2,7 @@ import { Octokit } from '@octokit/rest';
|
|
2
2
|
export declare const generateGithubAppToken: (config: any) => Promise<string>;
|
3
3
|
export declare function getGithubAppToken(org?: string, genGithubAppToken?: any): Promise<string>;
|
4
4
|
export declare function getOctokitForOrg(org?: string, paginated?: boolean, genGithubAppToken?: any): Promise<Octokit>;
|
5
|
+
export declare function getOctokitFromPat(envVar: string): Promise<Octokit>;
|
5
6
|
declare const _default: {
|
6
7
|
getOctokitForOrg: typeof getOctokitForOrg;
|
7
8
|
};
|
@@ -428,7 +428,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
428
428
|
verified_at: string;
|
429
429
|
};
|
430
430
|
};
|
431
|
-
author:
|
431
|
+
author: {
|
432
432
|
name?: string;
|
433
433
|
email?: string;
|
434
434
|
login: string;
|
@@ -451,8 +451,8 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
451
451
|
site_admin: boolean;
|
452
452
|
starred_at?: string;
|
453
453
|
user_view_type?: string;
|
454
|
-
}
|
455
|
-
committer:
|
454
|
+
} | Record<string, never>;
|
455
|
+
committer: {
|
456
456
|
name?: string;
|
457
457
|
email?: string;
|
458
458
|
login: string;
|
@@ -475,7 +475,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
475
475
|
site_admin: boolean;
|
476
476
|
starred_at?: string;
|
477
477
|
user_view_type?: string;
|
478
|
-
}
|
478
|
+
} | Record<string, never>;
|
479
479
|
parents: {
|
480
480
|
sha: string;
|
481
481
|
url: string;
|