Skip to content

Commit 15bc2e1

Browse files
author
Amelia Wattenberger
authored
Merge pull request #23 from githubocto/update-diagram
Add commit_message param
2 parents 25742b6 + c8b13dd commit 15bc2e1

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ The maximum number of nested folders to show files within. A higher number will
3030

3131
Default: 9
3232

33+
## `commit_message`
34+
35+
The commit message to use when updating the diagram. Useful for skipping CI. For example: Updating diagram [skip ci]
36+
37+
Default: Repo visualizer: updated diagram
38+
3339
## Example usage
3440

3541
You'll need to run the `actions/checkout` Action beforehand, to check out the code.

action.yml

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ inputs:
1111
max_depth:
1212
description: "The maximum number of nested folders to show files within. Default: 9"
1313
required: false
14+
commit_message:
15+
description: "The commit message to use when updating the diagram. Default: Repo visualizer: updated diagram"
16+
required: false
1417
runs:
1518
using: "node12"
1619
main: "index.js"

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -17916,6 +17916,7 @@ var main = async () => {
1791617916
core.endGroup();
1791717917
const maxDepth = core.getInput("max_depth") || 9;
1791817918
const colorEncoding = core.getInput("color_encoding") || "type";
17919+
const commitMessage = core.getInput("commit_message") || "Repo visualizer: updated diagram";
1791917920
const excludedPathsString = core.getInput("excluded_paths") || "node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.git,.vscode,package-lock.json,yarn.lock";
1792017921
const excludedPaths = excludedPathsString.split(",").map((str) => str.trim());
1792117922
const data = await processDir(`./`, excludedPaths);
@@ -17933,7 +17934,7 @@ var main = async () => {
1793317934
core.info("[INFO] No changes to the repo detected, exiting");
1793417935
return;
1793517936
}
17936-
await (0, import_exec.exec)("git", ["commit", "-m", "Repo visualizer: updated diagram"]);
17937+
await (0, import_exec.exec)("git", ["commit", "-m", commitMessage]);
1793717938
await (0, import_exec.exec)("git", ["push"]);
1793817939
console.log("All set!");
1793917940
};

src/index.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const main = async () => {
2424

2525
const maxDepth = core.getInput("max_depth") || 9
2626
const colorEncoding = core.getInput("color_encoding") || "type"
27+
const commitMessage = core.getInput("commit_message") || "Repo visualizer: updated diagram"
2728
const excludedPathsString = core.getInput("excluded_paths") || "node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.git,.vscode,package-lock.json,yarn.lock"
2829
const excludedPaths = excludedPathsString.split(",").map(str => str.trim())
2930
const data = await processDir(`./`, excludedPaths);
@@ -44,7 +45,7 @@ const main = async () => {
4445
return
4546
}
4647

47-
await exec('git', ['commit', '-m', "Repo visualizer: updated diagram"])
48+
await exec('git', ['commit', '-m', commitMessage])
4849
await exec('git', ['push'])
4950

5051
console.log("All set!")

0 commit comments

Comments
 (0)