action-docs
action-docs copied to clipboard
fail (exit code) there is an error
I'm looking at using action-docs as a pre-commit hook. It would be kind of nice to have the tool fail (exit with non zero) if there is an issue.
For example there is no readme.
No files match the pattern: README.md
Can you add some more details to reproduce your use case.
@jcook-uptycs just curious if you have this working as pre-commit hook?
curious if you have this working as pre-commit hook?
Kind of.
The pre-commit supplies {files} with a list of the action.yaml files.
I calculate what the README.md should be. THen touch the file to make sure it is there.
Then run action-docs
for ACTION in {files}
do
echo "Action file found: ${ACTION}"
ACTION_README=$(dirname "${ACTION}")/README.md
touch "${ACTION_README}"
pushd "$(dirname "${ACTION}")" || exit 1
npx -y action-docs --update-readme --no-banner || exit 1
popd || exit 1
done
@npalm
Can you add some more details to reproduce your use case.
It would be real helpful to have a command line option to give the path of an action.yaml (or multiple) and have action-docs run on the README in that path. It should create the README if needed.