Skip to content

Commit 1121214

Browse files
committed
Document the new input options
1 parent c5af940 commit 1121214

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ The maximum number of nested folders to show files within. A higher number will
5252

5353
Default: 9
5454

55+
## `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: `false`
62+
5563
## `commit_message`
5664

5765
The commit message to use when updating the diagram. Useful for skipping CI. For example: `Updating diagram [skip ci]`
@@ -64,6 +72,14 @@ The branch name to push the diagram to (branch will be created if it does not ye
6472

6573
For 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+
6783
## Example usage
6884

6985
You'll need to run the `actions/checkout` Action beforehand, to check out the code.
@@ -77,3 +93,30 @@ You'll need to run the `actions/checkout` Action beforehand, to check out the co
7793
output_file: "images/diagram.svg"
7894
excluded_paths: "dist,node_modules"
7995
```
96+
97+
98+
## Accessing the diagram
99+
100+
By default, this action will create a new commit with the diagram on the specified branch.
101+
102+
If you want to avoid new commits, you can create an artifact to accompany the workflow run,
103+
by specifying an `artifact_name`. You can then download the diagram using the
104+
[`actions/download-artifact`](https://github.com/marketplace/actions/download-a-build-artifact)
105+
action from a later step in your workflow,
106+
or by using the [GitHub API](https://docs.github.com/en/rest/reference/actions#artifacts).
107+
108+
Example:
109+
```yaml
110+
- name: Update diagram
111+
uses: githubocto/[email protected]
112+
with:
113+
output_file: "images/diagram.svg"
114+
artifact_name: my-diagram
115+
- name: Get artifact
116+
uses: actions/download-artifact@v2
117+
with:
118+
name: my-diagram
119+
path: downloads
120+
# Diagram now available at downloads/images/diagram.svg
121+
```
122+
Note that this will still also create a commit, unless you specify `push: false`!

0 commit comments

Comments
 (0)