From d45ab7a5192d6579bee58c2bb9c06dbccfcc585c Mon Sep 17 00:00:00 2001 From: Merve Noyan Date: Thu, 21 Sep 2023 14:16:14 +0200 Subject: [PATCH] Check if content is updated --- .github/workflows/autodocs.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/autodocs.yml b/.github/workflows/autodocs.yml index 24adaa957d5..0747181b817 100644 --- a/.github/workflows/autodocs.yml +++ b/.github/workflows/autodocs.yml @@ -26,11 +26,15 @@ jobs: - name: Update Docs run: | output="${{ steps.run-launcher-help.outputs.output }}" - rm /docs/source/basic_tutorials/launcher.md - echo '```' >> /docs/source/basic_tutorials/launcher.md - echo $output >> /docs/source/basic_tutorials/launcher.md - echo '```' >> /docs/source/basic_tutorials/launcher.md - echo "Docs are updated!" - git add launcher.md - git commit -m "Update launcher.md" - git push + launcher_content=$(/docs/source/basic_tutorials/launcher.md) + + if [ "$launcher_content" != "$output" ]; then + rm /docs/source/basic_tutorials/launcher.md + echo '```' >> /docs/source/basic_tutorials/launcher.md + echo $output >> /docs/source/basic_tutorials/launcher.md + echo '```' >> /docs/source/basic_tutorials/launcher.md + echo "Docs are updated!" + + git add launcher.md + git commit -m "Update launcher.md" + git push