To prevent installing Doc Detective on every run of the action, add it as a cached dependency within the action. Should default to the latest version of doc-detective, but will need to handle if version is specified, then calling that instead. If there is a performance penalty for calling a version other than what is installed, that's acceptable.
Worth considering versioning this Action to match the version of doc-detective and removing the version argument.