From 0eed63a4c60556f284db7be7ef79fd45016562d8 Mon Sep 17 00:00:00 2001 From: Andrey Butusov Date: Tue, 29 Oct 2024 21:25:58 +0300 Subject: [PATCH] workflows: add a check to update cli commands docs when changes occur Signed-off-by: Andrey Butusov --- .github/workflows/cli-docs-update.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cli-docs-update.yml b/.github/workflows/cli-docs-update.yml index 6bab251255..704a491212 100644 --- a/.github/workflows/cli-docs-update.yml +++ b/.github/workflows/cli-docs-update.yml @@ -15,19 +15,9 @@ jobs: with: fetch-depth: 0 - - name: Save current CLI docs files - run: | - mkdir -p backup_docs - cp -r docs/cli-commands/* backup_docs/ - - name: Generate new CLI doc files run: make cli-gendoc - - name: Compare CLI docs files + - name: Check for documentation changes run: | - DIFF_OUTPUT=$(diff -ur docs/cli-commands backup_docs || true) - if [ -n "$DIFF_OUTPUT" ]; then - echo "CLI documentation has not been updated correctly. Differences:" - echo "$DIFF_OUTPUT" - exit 1 - fi + git diff --exit-code -- docs/cli-commands/ || (echo "CLI documentation has not been updated correctly. Differences:" && git diff -- docs/cli-commands/)