diff --git a/.github/workflows/cli-docs-update.yml b/.github/workflows/cli-docs-update.yml new file mode 100644 index 0000000000..743bc47dbd --- /dev/null +++ b/.github/workflows/cli-docs-update.yml @@ -0,0 +1,36 @@ +name: CLI commands docs check + +on: + pull_request: + branches: + - master + - support/** + +jobs: + build: + runs-on: ubuntu-latest + name: cli-docs-check + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get changed CLI-related files + id: cli-diff + uses: tj-actions/changed-files@v42 + with: + files: | + cmd/neofs-cli/** + + - name: Get changed CLI doc files + id: docs-diff + uses: tj-actions/changed-files@v42 + with: + files: docs/cli-commands/** + + - name: Fail if CLI files are changed but the documentation is not updated + if: steps.cli-diff.outputs.any_changed == 'true' && steps.docs-diff.outputs.any_changed == 'false' + uses: actions/github-script@v7 + with: + script: | + core.setFailed('CLI documentation has not been updated')