@@ -26275,34 +26275,33 @@ var main = async () => {
26275
26275
const maxDepth = core.getInput("max_depth") || 9;
26276
26276
const customFileColors = JSON.parse(core.getInput("file_colors") || "{}");
26277
26277
const colorEncoding = core.getInput("color_encoding") || "type";
26278
- const commitMessage = core.getInput("commit_message") || "Repo visualizer: updated diagram";
26278
+ const commitMessage = core.getInput("commit_message") || "Repo visualizer: update diagram";
26279
26279
const excludedPathsString = core.getInput("excluded_paths") || "node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.git,.vscode,package-lock.json,yarn.lock";
26280
26280
const excludedPaths = excludedPathsString.split(",").map((str) => str.trim());
26281
26281
const excludedGlobsString = core.getInput("excluded_globs") || "";
26282
26282
const excludedGlobs = excludedGlobsString.split(";");
26283
26283
const branch = core.getInput("branch");
26284
26284
const data = await processDir(rootPath, excludedPaths, excludedGlobs);
26285
- const componentCodeString = import_server.default.renderToStaticMarkup(/* @__PURE__ */ import_react3.default.createElement(Tree, {
26286
- data,
26287
- maxDepth: +maxDepth,
26288
- colorEncoding,
26289
- customFileColors
26290
- }));
26291
- const outputFile = core.getInput("output_file") || "./diagram.svg";
26292
- core.setOutput("svg", componentCodeString);
26293
- await import_fs2.default.writeFileSync(outputFile, componentCodeString);
26294
26285
let doesBranchExist = true;
26295
26286
if (branch) {
26296
26287
await (0, import_exec.exec)("git", ["fetch"]);
26297
26288
try {
26298
- await (0, import_exec.exec)("git", ["rev-parse", "--verify", branch]);
26299
- await (0, import_exec.exec)("git", ["checkout", branch]);
26289
+ await (0, import_exec.exec)("git", ["switch", "-c", branch, "--track", `origin/${branch}`]);
26300
26290
} catch {
26301
26291
doesBranchExist = false;
26302
26292
core.info(`Branch ${
8000
branch} does not yet exist, creating ${branch}.`);
26303
26293
await (0, import_exec.exec)("git", ["checkout", "-b", branch]);
26304
26294
}
26305
26295
}
26296
+ const componentCodeString = import_server.default.renderToStaticMarkup(/* @__PURE__ */ import_react3.default.createElement(Tree, {
26297
+ data,
26298
+ maxDepth: +maxDepth,
26299
+ colorEncoding,
26300
+ customFileColors
26301
+ }));
26302
+ const outputFile = core.getInput("output_file") || "./diagram.svg";
26303
+ core.setOutput("svg", componentCodeString);
26304
+ await import_fs2.default.writeFileSync(outputFile, componentCodeString);
26306
26305
await (0, import_exec.exec)("git", ["add", outputFile]);
26307
26306
const diff = await execWithOutput("git", ["status", "--porcelain", outputFile]);
26308
26307
core.info(`diff: ${diff}`);
0 commit comments