From b3c3a414eba9289b73c0b77810d0d9874a478eb9 Mon Sep 17 00:00:00 2001 From: Carl Menezes Date: Fri, 11 Aug 2023 11:21:04 +1200 Subject: [PATCH] Update SDK docs link --- .github/scripts/update-docs-link.sh | 17 +++++++++-------- .github/workflows/publish-docs.yaml | 3 +++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/scripts/update-docs-link.sh b/.github/scripts/update-docs-link.sh index b559b2e2ec..5a45347cda 100755 --- a/.github/scripts/update-docs-link.sh +++ b/.github/scripts/update-docs-link.sh @@ -17,11 +17,12 @@ fi FILE=_typescript.mdx -pushd $CLONE_DIR -if [[ "$OSTYPE" == "darwin"* ]]; then - # On Mac OS, sed requires an empty string as an argument to -i to avoid creating a backup file - sed -i '' -E "s/[0-9]\\.[0-9]\\.[0-9](.* class=\"ts-immutable-sdk-ref-link\")/$VERSION\1/g;" $FILE -else - sed -i -E "s/[0-9]\\.[0-9]\\.[0-9](.* class=\"ts-immutable-sdk-ref-link\")/$VERSION\1/g;" $FILE -fi -popd +( + cd $CLONE_DIR; + if [ "$(uname)" == "Darwin" ]; then + # On Mac OS, sed requires an empty string as an argument to -i to avoid creating a backup file + sed -i '' -E "s/[0-9]\\.[0-9]\\.[0-9](.* class=\"ts-immutable-sdk-ref-link\")/$VERSION\1/g;" $FILE + else + sed -i -E "s/[0-9]\\.[0-9]\\.[0-9](.* class=\"ts-immutable-sdk-ref-link\")/$VERSION\1/g;" $FILE + fi +) diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml index 22c13364fb..88fd90aa87 100644 --- a/.github/workflows/publish-docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -57,6 +57,9 @@ jobs: - name: Build SDK Docs run: yarn docs:build + - name: Update version link + run: ./.github/scripts/update-docs-link.sh + - name: Create SDK Docs PR run: ./.github/scripts/push-docs-pr.sh shell: bash