Skip to content

Add commit_message param #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ The maximum number of nested folders to show files within. A higher number will

Default: 5

## `commit_message`

The commit message to use when updating the diagram. Useful for skipping CI. For example: Updating diagram [skip ci]

Default: Repo visualizer: updated diagram

## Example usage

You'll need to run the `actions/checkout` Action beforehand, to check out the code.
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ inputs:
max_depth:
description: "The maximum number of nested folders to show files within. Default: 9"
required: false
commit_message:
description: "The commit message to use when updating the diagram. Default: Repo visualizer: updated diagram"
required: false
runs:
using: "node12"
main: "index.js"
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17916,6 +17916,7 @@ var main = async () => {
core.endGroup();
const maxDepth = core.getInput("max_depth") || 9;
const colorEncoding = core.getInput("color_encoding") || "type";
const commitMessage = core.getInput("commit_message") || "Repo visualizer: updated diagram";
const excludedPathsString = core.getInput("excluded_paths") || "node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.git,.vscode,package-lock.json,yarn.lock";
const excludedPaths = excludedPathsString.split(",").map((str) => str.trim());
const data = await processDir(`./`, excludedPaths);
Expand All @@ -17933,7 +17934,7 @@ var main = async () => {
core.info("[INFO] No changes to the repo detected, exiting");
return;
}
await (0, import_exec.exec)("git", ["commit", "-m", "Repo visualizer: updated diagram"]);
await (0, import_exec.exec)("git", ["commit", "-m", commitMessage]);
await (0, import_exec.exec)("git", ["push"]);
console.log("All set!");
};
Expand Down
3 changes: 2 additions & 1 deletion src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const main = async () => {

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

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

console.log("All set!")
Expand Down