action-docs
Advanced tools
Comparing version 2.4.3 to 2.5.0
# Changelog | ||
## [2.5.0](https://github.com/npalm/action-docs/compare/v2.4.3...v2.5.0) (2024-10-12) | ||
### Features | ||
* add support for secrets on workflow_call ([#658](https://github.com/npalm/action-docs/issues/658)) ([f427c9a](https://github.com/npalm/action-docs/commit/f427c9ae4a461111334a2d7a6b0c05cafcff56ee)) | ||
### Bug Fixes | ||
* **deps:** bump yaml from 2.5.0 to 2.5.1 ([#692](https://github.com/npalm/action-docs/issues/692)) ([92755ae](https://github.com/npalm/action-docs/commit/92755aeeec47a015b2dcbdfba12155b65985cfb6)) | ||
* upgrade replace-in-file and figlet depenencies ([e585c0f](https://github.com/npalm/action-docs/commit/e585c0fd9a1409e417c6bee2f62ff6d869ffa388)) | ||
## [2.4.3](https://github.com/npalm/action-docs/compare/v2.4.2...v2.4.3) (2024-09-03) | ||
@@ -4,0 +17,0 @@ |
@@ -27,2 +27,3 @@ import { getLineBreak } from "./linebreak.js"; | ||
InputOutputType[InputOutputType["actionOutput"] = 2] = "actionOutput"; | ||
InputOutputType[InputOutputType["workflowSecret"] = 3] = "workflowSecret"; | ||
})(InputOutputType || (InputOutputType = {})); | ||
@@ -39,2 +40,3 @@ const inputOutputHeaders = { | ||
[InputOutputType.actionOutput]: ["name", "description"], | ||
[InputOutputType.workflowSecret]: ["name", "description", "required"], | ||
}; | ||
@@ -161,2 +163,3 @@ const inputOutputDefaults = { | ||
inputs: generateInputs(yml.on.workflow_call?.inputs, options, InputOutputType.workflowInput), | ||
secrets: generateSecrets(yml.on.workflow_call?.secrets, options), | ||
outputs: generateOutputs(yml.on.workflow_call?.outputs, options), | ||
@@ -179,2 +182,6 @@ runs: "", | ||
} | ||
function generateSecrets(data, options) { | ||
const secretMdTable = createMdTable(data, options, InputOutputType.workflowSecret); | ||
return createMarkdownSection(options, secretMdTable, "Secrets"); | ||
} | ||
function generateOutputs(data, options) { | ||
@@ -181,0 +188,0 @@ const outputMdTable = createMdTable(data, options, InputOutputType.actionOutput); |
{ | ||
"name": "action-docs", | ||
"version": "2.4.3", | ||
"version": "2.5.0", | ||
"description": "Generate GitHub action docs based on action.yml", | ||
@@ -17,3 +17,3 @@ "main": "lib/index.js", | ||
"lint": "eslint src/**/*.ts", | ||
"test": "jest --testTimeout=10000 --collect-coverage --coverage", | ||
"test": "jest --runInBand --testTimeout=10000 --collect-coverage --coverage", | ||
"test-default": "jest --testTimeout=10000 --testPathIgnorePatterns=__tests__/cli.test.ts --collect-coverage --coverage", | ||
@@ -59,3 +59,3 @@ "test-cli": "nyc jest --testTimeout=10000 --silent --testMatch=**/cli*test.ts && nyc report --reporter=lcov --reporter=html --report-dir=./coverage_nyc", | ||
"@types/showdown": "^2.0.6", | ||
"@typescript-eslint/parser": "^7.0.1", | ||
"@typescript-eslint/parser": "^8.8.1", | ||
"eslint": "^8.56.0", | ||
@@ -62,0 +62,0 @@ "eslint-import-resolver-typescript": "^3.6.1", |
@@ -37,2 +37,3 @@ import { LineBreakType, getLineBreak } from "./linebreak.js"; | ||
inputs: ActionInputsOutputs; | ||
secrets: ActionInputsOutputs; | ||
outputs: ActionInputsOutputs; | ||
@@ -71,2 +72,3 @@ } | ||
actionOutput, | ||
workflowSecret, | ||
} | ||
@@ -84,2 +86,3 @@ | ||
[InputOutputType.actionOutput]: ["name", "description"], | ||
[InputOutputType.workflowSecret]: ["name", "description", "required"], | ||
}; | ||
@@ -266,2 +269,3 @@ | ||
), | ||
secrets: generateSecrets(yml.on.workflow_call?.secrets, options), | ||
outputs: generateOutputs(yml.on.workflow_call?.outputs, options), | ||
@@ -292,2 +296,14 @@ runs: "", | ||
function generateSecrets( | ||
data: ActionInputsOutputs, | ||
options: DefaultOptions, | ||
): string { | ||
const secretMdTable = createMdTable( | ||
data, | ||
options, | ||
InputOutputType.workflowSecret, | ||
); | ||
return createMarkdownSection(options, secretMdTable, "Secrets"); | ||
} | ||
function generateOutputs( | ||
@@ -294,0 +310,0 @@ data: ActionInputsOutputs, |
50303
945