diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f4277d876..419a65bb9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 1 # Need to full repo for getting all tags + fetch-depth: 0 # Need to full repo for getting all tags - name: Check available tags run: | git for-each-ref --format "%(refname)" @@ -75,9 +75,9 @@ jobs: tar -xvf doc_artifact/artifact.tar --directory . rm -r doc_artifact # If there are tags simply use the latest one via lexicographic sort - if [ ls -v* > /dev/null 2>&1 ]; then - latest_version=$(ls -v* | tail -n1) - sed -i s'/__LATEST__/${latest_version}/g' index.html + if ls -d v*/ > /dev/null 2>&1; then + latest_version=$(ls -d v*/ | tail -n1) + sed -i s'/__LATEST__/'"${latest_version%/}"'/g' index.html else # Fall back to whatever we just built now sed -i s'/__LATEST__/${{ github.ref_name }}/g' index.html