From a93f4cc8aa29fc287e64fbcd113bdcc445917f0d Mon Sep 17 00:00:00 2001 From: Osman Hadzic Date: Wed, 13 Nov 2024 16:07:04 +0100 Subject: [PATCH] Update docs-workflow.yaml Add comparison and substitution for GET_STARTED.md in documentation workflow. Closes #79 Signed-off-by: Osman Hadzic --- .github/workflows/docs-workflow.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/docs-workflow.yaml b/.github/workflows/docs-workflow.yaml index 0544ef1..4e84833 100644 --- a/.github/workflows/docs-workflow.yaml +++ b/.github/workflows/docs-workflow.yaml @@ -54,6 +54,20 @@ jobs: rm -rf docs/$DOCS_DIRNAME mkdir -p docs/$DOCS_DIRNAME cp -r astarte-device-sdk-csharp/docs/out/html/* docs/$DOCS_DIRNAME/ + - name: Compare and copy get started + id: cmp-and-copy-get-started + if: steps.check-release-branch.outputs.RESULT == 'OK' + run: | + our_get_started="./astarte-device-sdk-csharp/GET_STARTED.md" + their_get_started="./sdk-doc/source/get_started/csharp.md" + if cmp -s "$our_get_started" "$their_get_started"; then + echo "Get started are identical, no need for substitution" + echo "RESULT=NO_SUBSTITUTION" >> $GITHUB_OUTPUT + else + echo "Our get started is different, substituting theirs" + cp "$our_get_started" "$their_get_started" + echo "RESULT=SUBSTITUTION" >> $GITHUB_OUTPUT + fi - name: Commit files working-directory: ./docs run: |