Skip to content
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

feat: add support for workflows and readme all option #436

Merged
merged 11 commits into from
Mar 14, 2024
31 changes: 17 additions & 14 deletions README.md
npalm marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
<a href="https://github.com/npalm/action-docs-action/actions"><img alt="action-docs-action status" src="https://github.com/npalm/action-docs-action/actions/workflows/ci.yml/badge.svg"></a>
</p>

<!-- action-docs-header action="action.yml" -->
<!-- action-docs-header source="action.yml" -->
# Action to update GitHub Action documentation
<!-- action-docs-header action="action.yml" -->
<!-- action-docs-header source="action.yml" -->

This action wraps [action-docs](https://github.com/npalm/action-docs) to update action documentation. By default the action will update `README.md` based on the the `action.yml`. See the parameters for changing the defaults.
This action wraps [action-docs](https://github.com/npalm/action-docs) to update action and workflow documentation. By default the action will update `README.md` based on the `action.yml`. See the parameters for changing the defaults.

## Usages

The action will update you readme by replacing html comment tags. Add one of more tags based on the following template to your repo: `<!-- action-docs-(header | description | inputs | outputs | runs -->` to add the corresponding section.
The action will update your readme by replacing html comment tags. Add one of more tags based on the following template to your repo: `<!-- action-docs-(header | description | inputs | outputs | runs | usage | all) source="action-file.yml" -->` to add the corresponding section.

- `header` : to add/updae a header based on the name of the action
- `description` : to add/update a section with a descriptions of the action
- `inputs`: to add/update a section with inputs of the action
- `outputs`: to add/update a section with outputs of the action
- `runs`: to add/update a section of the environment required to run.
- `header` : to add/update a header based on the name of the action/workflow (only added if action option `includeNameHeader` is set to true)
- `description` : to add/update a section with a descriptions of the action (applicable to actions only)
- `inputs`: to add/update a section with inputs of the action/workflow
- `outputs`: to add/update a section with outputs of the action/workflow
- `runs`: to add/update a section of the environment required to run (applicable to actions only)
- `usage`: to add/update a section containing an example of how to call the action/workflow. This comment also requires passing a project and a version to use in the example e.g. `<!-- action-docs-usage source="action-file.yml" project="npalm/action-docs" version="v2.3.0" -->`.
- `all`: to include all of the above in order

In your workflow add the action, see below for the available parameters.

Expand All @@ -27,24 +29,25 @@ In your workflow add the action, see below for the available parameters.
The action will not commit any change, to ensure the changes are persisted you can use an action to [commit](https://github.com/stefanzweifel/git-auto-commit-action) or raise a [pull request](https://github.com/peter-evans/create-pull-request).


<!-- action-docs-inputs action="action.yml" -->
<!-- action-docs-inputs source="action.yml" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `readme` | <p>Readme file to update.</p> | `false` | `README.md` |
| `actionFile` | <p>THe action definition file.</p> | `false` | `action.yml` |
| `actionFile` | <p>The action definition file.</p> | `false` | `""` |
| `sourceFile` | <p>The action or workflow definition file.</p> | `false` | `action.yml` |
| `includeNameHeader` | <p>Include the name header in the updated readme.</p> | `false` | `true` |
| `tocLevel` | <p>TOC level used for the headers. The <code>includeNameHeader</code> input is influecing the TOC level, setting <code>includeNameHeader</code> to true will increase the TOC level by 1.</p> | `false` | `2` |
| `lineBreaks` | <p>Line breaks to be used in updated readme (LF|CR|CRLF).</p> | `false` | `LF` |
<!-- action-docs-inputs action="action.yml" -->
<!-- action-docs-inputs source="action.yml" -->


<!-- action-docs-runs action="action.yml" -->
<!-- action-docs-runs source="action.yml" -->
## Runs

This action is a `node20` action.
<!-- action-docs-runs action="action.yml" -->
<!-- action-docs-runs source="action.yml" -->
## License

This project are released under the [MIT License](./LICENSE).
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ inputs:
required: false
default: README.md
actionFile:
description: 'THe action definition file.'
description: 'The action definition file.'
npalm marked this conversation as resolved.
Show resolved Hide resolved
required: false
deprecationMessage: 'This input is replaced by sourceFile'
sourceFile:
description: 'The action or workflow definition file.'
required: false
default: action.yml
includeNameHeader:
Expand Down
Loading