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

fail (exit code) there is an error #345

Open
jcook-uptycs opened this issue Dec 30, 2022 · 4 comments
Open

fail (exit code) there is an error #345

jcook-uptycs opened this issue Dec 30, 2022 · 4 comments

Comments

@jcook-uptycs
Copy link

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
@npalm
Copy link
Owner

npalm commented Mar 2, 2023

Can you add some more details to reproduce your use case.

@codezninja
Copy link

codezninja commented Sep 23, 2023

@jcook-uptycs just curious if you have this working as pre-commit hook?

@jcook-uptycs
Copy link
Author

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

@jcook-uptycs
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants