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
3 changes: 2 additions & 1 deletion README.md
npalm marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ The action will not commit any change, to ensure the changes are persisted you c
| 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` |
Expand Down
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
260 changes: 182 additions & 78 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.0",
"action-docs": "^2.1.0"
"action-docs": "^2.2.0"
},
"devDependencies": {
"@types/node": "^20.11.24",
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ async function run(): Promise<void> {
try {
const readmeFile: string = core.getInput('readme', { required: true });
const tocLevel: number = parseInt(core.getInput('tocLevel', { required: true }));
const actionFile: string = core.getInput('actionFile', { required: true });
const actionFile: string = core.getInput('actionFile');
const sourceFile: string = actionFile || core.getInput('sourceFile');
const lineBreaks = core.getInput('lineBreaks', { required: true }) as 'LF' | 'CR' | 'CRLF';
const includeNameHeader = core.getInput('includeNameHeader', { required: true }) === 'true';

await generateActionMarkdownDocs({
actionFile,
sourceFile,
readmeFile,
updateReadme: true,
tocLevel,
Expand Down
Loading