@@ -8,23 +8,23 @@ For a full demo, check out the [githubocto/repo-visualizer-demo](https://github.
8
8
9
9
## Inputs
10
10
11
- ## ` output_file `
11
+ ### ` output_file `
12
12
13
13
A path (relative to the root of your repo) to where you would like the diagram to live.
14
14
15
15
For example: images/diagram.svg
16
16
17
17
Default: diagram.svg
18
18
19
- ## ` excluded_paths `
19
+ ### ` excluded_paths `
20
20
21
21
A list of paths to folders to exclude from the diagram, separated by commas.
22
22
23
23
For example: dist,node_modules
24
24
25
25
Default: node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.vscode,package-lock.json,yarn.lock
26
26
27
- ## ` excluded_globs `
27
+ ### ` excluded_globs `
28
28
29
29
A semicolon-delimited array of file [ globs] ( https://globster.xyz/ ) to exclude from the diagram, using [ micromatch] ( https://github.com/micromatch/micromatch ) syntax. Provided as an array.
30
30
@@ -38,32 +38,54 @@ excluded_globs: 'frontend/*.spec.js;**/*.{png,jpg};**/!(*.module).ts'
38
38
# - '**/!(*.module).ts' # all TS files except module files
39
39
```
40
40
41
- ## ` root_path `
41
+ ### ` root_path `
42
42
43
43
The directory (and its children) that you want to visualize in the diagram, relative to the repository root.
44
44
45
45
For example: ` src/ `
46
46
47
47
Default: ` '' ` (current directory)
48
48
49
- ## ` max_depth `
49
+ ### ` max_depth `
50
50
51
51
The maximum number of nested folders to show files within. A higher number will take longer to render.
52
52
53
53
Default: 9
54
54
55
- ## ` commit_message `
55
+ ### ` should_push `
56
+
57
+ Whether to make a new commit with the diagram and push it to the original repository.
58
+
59
+ Should be a boolean value, i.e. ` true ` or ` false ` . See ` commit_message ` and ` branch ` for how to customise the commit.
60
+
61
+ Default: ` true `
62
+
63
+ ### ` commit_message `
56
64
57
65
The commit message to use when updating the diagram. Useful for skipping CI. For example: ` Updating diagram [skip ci] `
58
66
59
67
Default: ` Repo visualizer: updated diagram `
60
68
61
- ## ` branch `
69
+ ### ` branch `
62
70
63
71
The branch name to push the diagram to (branch will be created if it does not yet exist).
64
72
65
73
For example: ` diagram `
66
74
75
+ ### ` artifact_name `
76
+
77
+ The name of an [ artifact] ( https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts ) to create containing the diagram.
78
+
79
+ If unspecified, no artifact will be created.
80
+
81
+ Default: ` '' ` (no artifact)
82
+
83
+ ## Outputs
84
+
85
+ ### ` svg `
86
+
87
+ The contents of the diagram as text. This can be used if you don't want to handle new files.
88
+
67
89
## Example usage
68
90
69
91
You'll need to run the ` actions/checkout ` Action beforehand, to check out the code.
@@ -77,3 +99,34 @@ You'll need to run the `actions/checkout` Action beforehand, to check out the co
77
99
output_file : " images/diagram.svg"
78
100
excluded_paths : " dist,node_modules"
79
101
` ` `
102
+
103
+
104
+ ## Accessing the diagram
105
+
106
+ By default, this action will create a new commit with the diagram on the specified branch.
107
+
108
+ If you want to avoid new commits, you can create an artifact to accompany the workflow run,
109
+ by specifying an ` artifact_name`. You can then download the diagram using the
110
+ [`actions/download-artifact`](https://github.com/marketplace/actions/download-a-build-artifact)
111
+ action from a later step in your workflow,
112
+ or by using the [GitHub API](https://docs.github.com/en/rest/reference/actions#artifacts).
113
+
114
+ Example :
115
+ ` ` ` yaml
116
+ - name: Update diagram
117
+ id: make_diagram
118
+ uses: githubocto/repo-visualizer@0.6.1
119
+ with:
120
+ output_file: "images/diagram.svg"
121
+ artifact_name: my-diagram
122
+ - name: Get artifact
123
+ uses: actions/download-artifact@v2
124
+ with:
125
+ name: my-diagram
126
+ path: downloads
127
+ # Diagram now available at downloads/images/diagram.svg
128
+ ` ` `
129
+ Note that this will still also create a commit, unless you specify `should_push : false`!
130
+
131
+ Alternatively, the SVG description of the diagram is available in the `svg` output,
132
+ which you can refer to in your workflow as e.g. `${{ steps.make_diagram.outputs.svg }}`.
0 commit comments