@@ -26275,34 +26275,33 @@ var main = async () => {
2627526275 const maxDepth = core.getInput("max_depth") || 9;
2627626276 const customFileColors = JSON.parse(core.getInput("file_colors") || "{}");
2627726277 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";
2627926279 const excludedPathsString = core.getInput("excluded_paths") || "node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.git,.vscode,package-lock.json,yarn.lock";
2628026280 const excludedPaths = excludedPathsString.split(",").map((str) => str.trim());
2628126281 const excludedGlobsString = core.getInput("excluded_globs") || "";
2628226282 const excludedGlobs = excludedGlobsString.split(";");
2628326283 const branch = core.getInput("branch");
2628426284 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);
2629426285 let doesBranchExist = true;
2629526286 if (branch) {
2629626287 await (0, import_exec.exec)("git", ["fetch"]);
2629726288 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}`]);
2630026290 } catch {
2630126291 doesBranchExist = false;
2630226292 core.info(`Branch ${branch} does not yet exist, creating ${branch}.`);
2630326293 await (0, import_exec.exec)("git", ["checkout", "-b", branch]);
2630426294 }
2630526295 }
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);
2630626305 await (0, import_exec.exec)("git", ["add", outputFile]);
2630726306 const diff = await execWithOutput("git", ["status", "--porcelain", outputFile]);
2630826307 core.info(`diff: ${diff}`);
0 commit comments