@@ -8,23 +8,23 @@ For a full demo, check out the [githubocto/repo-visualizer-demo](https://github.
88
99## Inputs
1010
11- ## ` output_file `
11+ ### ` output_file `
1212
1313A path (relative to the root of your repo) to where you would like the diagram to live.
1414
1515For example: images/diagram.svg
1616
1717Default: diagram.svg
1818
19- ## ` excluded_paths `
19+ ### ` excluded_paths `
2020
2121A list of paths to folders to exclude from the diagram, separated by commas.
2222
2323For example: dist,node_modules
2424
2525Default: node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.vscode,package-lock.json,yarn.lock
2626
27- ## ` excluded_globs `
27+ ### ` excluded_globs `
2828
2929A 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.
3030
@@ -38,32 +38,54 @@ excluded_globs: 'frontend/*.spec.js;**/*.{png,jpg};**/!(*.module).ts'
3838# - '**/!(*.module).ts' # all TS files except module files
3939```
4040
41- ## ` root_path `
41+ ### ` root_path `
4242
4343The directory (and its children) that you want to visualize in the diagram, relative to the repository root.
4444
4545For example: ` src/ `
4646
4747Default: ` '' ` (current directory)
4848
49- ## ` max_depth `
49+ ### ` max_depth `
5050
5151The maximum number of nested folders to show files within. A higher number will take longer to render.
5252
5353Default: 9
5454
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 `
5664
5765The commit message to use when updating the diagram. Useful for skipping CI. For example: ` Updating diagram [skip ci] `
5866
5967Default: ` Repo visualizer: updated diagram `
6068
61- ## ` branch `
69+ ### ` branch `
6270
6371The branch name to push the diagram to (branch will be created if it does not yet exist).
6472
6573For example: ` diagram `
6674
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+
6789## Example usage
6890
6991You'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
7799 output_file : " images/diagram.svg"
78100 excluded_paths : " dist,node_modules"
79101` ` `
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/[email protected] 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