@fern-api/generator-cli 0.9.48 → 0.9.49

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.
Files changed (2) hide show
  1. package/dist/cli.js +13 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -42713,6 +42713,16 @@ ${prBody}`;
42713
42713
  // src/pipeline/github/pushSignedCommit.ts
42714
42714
  var MAX_CONCURRENT_PUSH_RETRIES = 3;
42715
42715
  var MAX_SIGNED_CHAIN_LENGTH = 20;
42716
+ var PAT_TOKEN_PREFIXES = ["ghp_", "github_pat_"];
42717
+ function resolveCommitAuthor(token, author) {
42718
+ if (author != null) {
42719
+ return author;
42720
+ }
42721
+ if (PAT_TOKEN_PREFIXES.some((prefix) => token.startsWith(prefix))) {
42722
+ return { name: FERN_BOT_NAME2, email: FERN_BOT_EMAIL2 };
42723
+ }
42724
+ return void 0;
42725
+ }
42716
42726
  async function pushSignedCommit({
42717
42727
  repository,
42718
42728
  octokit,
@@ -43108,7 +43118,7 @@ var GithubStep = class extends BaseStep {
43108
43118
  repo,
43109
43119
  branch: prBranch,
43110
43120
  force: isUpdatingExistingPR,
43111
- author: this.config.author,
43121
+ author: resolveCommitAuthor(this.config.token, this.config.author),
43112
43122
  logger: this.logger
43113
43123
  });
43114
43124
  const pushedBranch = await repository.getCurrentBranch();
@@ -43245,7 +43255,7 @@ var GithubStep = class extends BaseStep {
43245
43255
  branch: baseBranch,
43246
43256
  force: false,
43247
43257
  rebaseOnConflict: true,
43248
- author: this.config.author,
43258
+ author: resolveCommitAuthor(this.config.token, this.config.author),
43249
43259
  logger: this.logger
43250
43260
  });
43251
43261
  const pushedBranch = await repository.getCurrentBranch();
@@ -43287,7 +43297,7 @@ var GithubStep = class extends BaseStep {
43287
43297
  branch: baseBranch,
43288
43298
  force: false,
43289
43299
  rebaseOnConflict: true,
43290
- author: this.config.author,
43300
+ author: resolveCommitAuthor(this.config.token, this.config.author),
43291
43301
  logger: this.logger
43292
43302
  });
43293
43303
  const pushedBranch = await repository.getCurrentBranch();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/generator-cli",
3
- "version": "0.9.48",
3
+ "version": "0.9.49",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/fern-api/fern.git",