From e6a93808800753d626cd3c3b3a0b75300ed29feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Werner?= Date: Mon, 7 Aug 2023 16:03:12 +0200 Subject: [PATCH] sync docs workflow optimization --- .github/scripts/sync_docs.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/scripts/sync_docs.sh b/.github/scripts/sync_docs.sh index ae870a728d..a05e1ab238 100755 --- a/.github/scripts/sync_docs.sh +++ b/.github/scripts/sync_docs.sh @@ -36,12 +36,15 @@ elif [ "$EVENT" == "release" ]; then # Check if contrib_versions.json exists and modify it if required if [[ -f $VERSION_FILE ]]; then - jq --arg new_version "$new_version" 'del(.[] | select(. == $new_version))' $VERSION_FILE >temp.json && mv temp.json $VERSION_FILE - jq 'sort | reverse' ${VERSION_FILE} >temp.json && mv temp.json ${VERSION_FILE} + jq --arg new_version "$new_version" 'del(.[] | select(. == $new_version))' $VERSION_FILE > temp.json && mv temp.json $VERSION_FILE fi # Run docusaurus versioning command $DOCUSAURUS_COMMAND "${new_version}" + + if [[ -f $VERSION_FILE ]]; then + jq 'sort | reverse' ${VERSION_FILE} > temp.json && mv temp.json ${VERSION_FILE} + fi fi # Push changes