@fern-api/generator-cli 0.9.55 → 0.9.56
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/dist/cli.js +31 -25
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -43284,7 +43284,9 @@ var GithubStep = class extends BaseStep {
|
|
|
43284
43284
|
let isUpdatingExistingPR = false;
|
|
43285
43285
|
let generationBaseSha;
|
|
43286
43286
|
let existingPR;
|
|
43287
|
-
if (
|
|
43287
|
+
if (this.config.previewMode && this.config.token === "") {
|
|
43288
|
+
this.logger.debug("Preview mode without a GitHub token: skipping lookup of existing PRs");
|
|
43289
|
+
} else if (!this.config.automationMode) {
|
|
43288
43290
|
existingPR = await findExistingUpdatablePR(octokit, owner, repo, baseBranch, this.logger);
|
|
43289
43291
|
}
|
|
43290
43292
|
if (existingPR != null) {
|
|
@@ -43352,30 +43354,34 @@ var GithubStep = class extends BaseStep {
|
|
|
43352
43354
|
success: true,
|
|
43353
43355
|
updatedExistingPr: isUpdatingExistingPR
|
|
43354
43356
|
};
|
|
43355
|
-
if (
|
|
43356
|
-
|
|
43357
|
-
|
|
43358
|
-
|
|
43359
|
-
|
|
43360
|
-
|
|
43361
|
-
|
|
43362
|
-
|
|
43363
|
-
|
|
43364
|
-
|
|
43365
|
-
|
|
43366
|
-
|
|
43367
|
-
|
|
43368
|
-
this.
|
|
43369
|
-
|
|
43370
|
-
|
|
43371
|
-
|
|
43372
|
-
|
|
43373
|
-
|
|
43374
|
-
|
|
43375
|
-
|
|
43376
|
-
|
|
43377
|
-
|
|
43378
|
-
|
|
43357
|
+
if (this.config.previewMode) {
|
|
43358
|
+
this.logger.info(
|
|
43359
|
+
`Preview mode: changes committed locally on branch ${prBranch} at ${this.outputDir}; skipping push and pull request. Re-run without --preview to publish.`
|
|
43360
|
+
);
|
|
43361
|
+
return result;
|
|
43362
|
+
}
|
|
43363
|
+
await pushSignedCommit({
|
|
43364
|
+
repository,
|
|
43365
|
+
octokit,
|
|
43366
|
+
owner,
|
|
43367
|
+
repo,
|
|
43368
|
+
branch: prBranch,
|
|
43369
|
+
force: isUpdatingExistingPR,
|
|
43370
|
+
author: resolveCommitAuthor(this.config.token, this.config.author),
|
|
43371
|
+
logger: this.logger
|
|
43372
|
+
});
|
|
43373
|
+
const pushedBranch = await repository.getCurrentBranch();
|
|
43374
|
+
result.branchUrl = `https://${remote}/${owner}/${repo}/tree/${pushedBranch}`;
|
|
43375
|
+
this.logger.info(`Pushed branch: ${result.branchUrl}`);
|
|
43376
|
+
if (generationBaseSha != null) {
|
|
43377
|
+
try {
|
|
43378
|
+
const sanitizedName = this.config.generatorName?.replace(/\//g, "--");
|
|
43379
|
+
const tagName = sanitizedName != null ? `fern-generation-base--${sanitizedName}` : "fern-generation-base";
|
|
43380
|
+
await repository.createAndPushTag(tagName, generationBaseSha);
|
|
43381
|
+
this.logger.debug(`Pushed ${tagName} tag for generation tracking`);
|
|
43382
|
+
result.generationBaseTagSha = generationBaseSha;
|
|
43383
|
+
} catch (error) {
|
|
43384
|
+
this.logger.debug(`Could not push generation tag: ${extractErrorMessage(error)}`);
|
|
43379
43385
|
}
|
|
43380
43386
|
}
|
|
43381
43387
|
const headSha = await repository.getHeadSha();
|