Skip to content

Commit

Permalink
[build] Add build check to ensure CLI docs are up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
Breakthrough committed Nov 13, 2024
1 parent 9d0af3c commit 2de7ca9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ jobs:
git config --global user.name github-actions
git config --global user.email [email protected]
- name: Check CLI Documentation
shell: bash
run: |
if [[ `git status --porcelain=1 | wc -l` -ne 0 ]]; then
echo "CLI documentation out of date: docs/cli.rst does not match output after running docs/generate_cli_docs.py!"
exit 1
fi
- name: Generate Docs
run: |
sphinx-build -b html docs build
Expand Down
1 change: 1 addition & 0 deletions docs/cli.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.. NOTE: This file is auto-generated by docs/generate_cli_docs.py and should not be modified.
************************************************************************
``scenedetect`` 🎬 Command
Expand Down
1 change: 1 addition & 0 deletions docs/generate_cli_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def create_help() -> ty.Tuple[str, ty.List[str]]:
def main():
help, commands = create_help()
help = patch_help(help, commands)
help = ".. NOTE: This file is auto-generated by docs/generate_cli_docs.py and should not be modified.\n" + help
with open("docs/cli.rst", "wb") as f:
f.write(help.encode())

Expand Down

0 comments on commit 2de7ca9

Please sign in to comment.