@firestartr/cli 1.39.5 → 1.40.0

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
@@ -283259,6 +283259,11 @@ async function getOctokitForOrg(org = 'default', paginated = false, genGithubApp
283259
283259
  }
283260
283260
  return new dist_src_Octokit(options);
283261
283261
  }
283262
+ async function getOctokitFromPat(envVar) {
283263
+ return new dist_src_Octokit({
283264
+ auth: process.env[envVar],
283265
+ });
283266
+ }
283262
283267
  /* harmony default export */ const src_auth = ({ getOctokitForOrg });
283263
283268
 
283264
283269
  ;// CONCATENATED MODULE: ../github/src/organization.ts
@@ -283871,6 +283876,7 @@ async function createOrphanBranch(repo, branch, owner = 'prefapp') {
283871
283876
  team: team,
283872
283877
  user: user,
283873
283878
  getOctokitForOrg: getOctokitForOrg,
283879
+ getOctokitFromPat: getOctokitFromPat,
283874
283880
  generateGithubAppToken: generateGithubAppToken,
283875
283881
  getGithubAppToken: getGithubAppToken,
283876
283882
  auth: src_auth,
@@ -288871,7 +288877,10 @@ async function downloadFeatureTarball(repo, featureName, version, owner = 'prefa
288871
288877
  if (!release)
288872
288878
  throw new Error(`Release ${featureName}-v${version} not found`);
288873
288879
  const ref = release['tag_name'];
288874
- const octokit = await github_0.getOctokitForOrg(owner);
288880
+ // Only use pat if the owner is prefapp
288881
+ const octokit = owner === 'prefapp'
288882
+ ? await github_0.getOctokitFromPat('PREFAPP_BOT_PAT')
288883
+ : await github_0.getOctokitForOrg(owner);
288875
288884
  const response = await octokit.request(`GET /repos/${owner}/${repo}/tarball/${ref}`, { owner, repo, ref });
288876
288885
  const tarballExtractPath = catalog_common.features.tarballs.getFeaturesExtractPath(featureName, version, { createIfNotExists: true });
288877
288886
  const tarballPath = catalog_common.features.tarballs.getFeatureTarballDownloadPath(featureName, version);
@@ -300620,10 +300629,21 @@ async function tfWorkspacePlan(opts) {
300620
300629
  await addPlanStatusCheck(pull, tfOutput, 'completed');
300621
300630
  }
300622
300631
  catch (e) {
300623
- tfworkspaceplans_fDebug(`Error: ${e.message}`, 'error');
300624
- await addPlanStatusCheck(pull, e.message, 'completed', true);
300632
+ console.error(e);
300633
+ let message = '';
300634
+ if (e && typeof e === 'string') {
300635
+ message = e;
300636
+ }
300637
+ else if (e && typeof e === 'object' && e.message) {
300638
+ message = e.message;
300639
+ }
300640
+ else {
300641
+ message = 'An unknown error occurred';
300642
+ }
300643
+ tfworkspaceplans_fDebug(`Error: ${message}`, 'error');
300644
+ await addPlanStatusCheck(pull, message, 'completed', true);
300625
300645
  tfworkspaceplans_fDebug('Publishing plan');
300626
- await publishPlan(cr, e.message, prNumber, repo, owner);
300646
+ await publishPlan(cr, message, prNumber, repo, owner);
300627
300647
  }
300628
300648
  }
300629
300649
  function getCommandByStatus(status) {
@@ -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: Record<string, never> | {
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: Record<string, never> | {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.39.5",
3
+ "version": "1.40.0",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",