Skip to content

Commit

Permalink
feat: add support for workflows and readme all option (#436)
Browse files Browse the repository at this point in the history
* Update action-docs to v2.2.0

* update yarn lock file

* Add sourceFile input and deprecate actionFile

* Change ?? to ||

* chore(ci): Updating dist and docs

* Update to v2.3.0

* Update readme

* chore(ci): Updating dist and docs

* Reword example so it doesn't generate comments and add  option doc

* Updated to v2.4.0

* chore(ci): Updating dist and docs

---------

Co-authored-by: larmitage-bjss <larmitage-bjss@users.noreply.github.com>
  • Loading branch information
larmitage-bjss and larmitage-bjss authored Mar 14, 2024
1 parent ca7f1c5 commit 8b5909f
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 148 deletions.
31 changes: 17 additions & 14 deletions README.md
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.<br/><em>Deprecated: This input is replaced by sourceFile</em></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.'
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

0 comments on commit 8b5909f

Please sign in to comment.