Skip to content

Commit 26db00c

Browse files
committed
Add 'root_path' option
1 parent aa98244 commit 26db00c

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ For example: dist,node_modules
2424

2525
Default: node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.vscode,package-lock.json,yarn.lock
2626

27+
28+
## `root_path`
29+
30+
The directory you want this action to run into
31+
32+
Default: ./
33+
2734
## `max_depth`
2835

2936
The maximum number of nested folders to show files within. A higher number will take longer to render.

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
excluded_paths:
99
description: "A list of paths to exclude from the diagram, separated by commas. For example: dist,node_modules"
1010
required: false
11+
root_path:
12+
description: "The directory you want this action to run into. Default: ./"
13+
required: false
1114
max_depth:
1215
description: "The maximum number of nested folders to show files within. Default: 9"
1316
required: false

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17914,13 +17914,14 @@ var main = async () => {
1791417914
`${username}@users.noreply.github.com`
1791517915
]);
1791617916
core.endGroup();
17917+
const rootPath = core.getInput("root_path") || "./";
1791717918
const maxDepth = core.getInput("max_depth") || 9;
1791817919
const colorEncoding = core.getInput("color_encoding") || "type";
1791917920
const commitMessage = core.getInput("commit_message") || "Repo visualizer: updated diagram";
1792017921
const excludedPathsString = core.getInput("excluded_paths") || "node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.git,.vscode,package-lock.json,yarn.lock";
1792117922
const excludedPaths = excludedPathsString.split(",").map((str) => str.trim());
1792217923
const branch = core.getInput("branch");
17923-
const data = await processDir(`./`, excludedPaths);
17924+
const data = await processDir(rootPath, excludedPaths);
1792417925
const componentCodeString = import_server.default.renderToStaticMarkup(/* @__PURE__ */ import_react3.default.createElement(Tree, {
1792517926
data,
1792617927
maxDepth: +maxDepth,

0 commit comments

Comments
 (0)