diff --git a/.github/workflows/check-latest-version.yml b/.github/workflows/check-latest-version.yml index 6a1d96f5..ea8a1448 100644 --- a/.github/workflows/check-latest-version.yml +++ b/.github/workflows/check-latest-version.yml @@ -15,7 +15,8 @@ jobs: run: | version=$(curl -s https://api.github.com/repos/jumpserver/jumpserver/releases/latest | jq -r .tag_name) echo "Current Version: ${version}" - if [ -z "${version}" ]; then + if [ -z "${version}" ] || [ "${version}" = "null" ] || ! echo "${version}" | grep -q '^v'; then + echo "Invalid or missing version (API error / rate limit?), aborting to avoid corrupting mkdocs.yml" exit 1 fi echo "version=${version}" >> $GITHUB_ENV @@ -24,7 +25,7 @@ jobs: - name: Update Version if: env.update == 'true' run: | - sed -i "s@tag: v.*@tag: ${{ env.version }}@" mkdocs.yml + sed -i "s@tag: .*@tag: ${{ env.version }}@" mkdocs.yml git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add . diff --git a/mkdocs.yml b/mkdocs.yml index bb44f171..90e14775 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -247,7 +247,7 @@ markdown_extensions: extra: jumpserver: - tag: null + tag: v5.0.0 client_tag: 4.1.7 search: separator: '[\s\-\.]+'