diff --git a/.github/workflows/pydpf-post.yml b/.github/workflows/pydpf-post.yml index 50b68ecf32b..7f5af877905 100644 --- a/.github/workflows/pydpf-post.yml +++ b/.github/workflows/pydpf-post.yml @@ -122,7 +122,7 @@ jobs: echo branch="$BranchName" if [ "$BranchName" = '' ]; then - BranchName=$(git ls-remote --tags --refs $REPO | tail -n1 | cut -d/ -f3) + BranchName=$(git ls-remote --tags --sort="v:refname" --refs $REPO | tail -n1 | cut -d/ -f3) fi echo branch=$BranchName git clone --single-branch --branch "$BranchName" $REPO