From a1f11c68e44375ba0400f31b57034f23a450545d Mon Sep 17 00:00:00 2001 From: peb-adr Date: Fri, 17 May 2024 11:08:56 +0200 Subject: [PATCH] Properly sort staging/* refs to get latest branch (#246) --- .github/workflows/pick-to-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pick-to-staging.yml b/.github/workflows/pick-to-staging.yml index dacf79b..7191ed4 100644 --- a/.github/workflows/pick-to-staging.yml +++ b/.github/workflows/pick-to-staging.yml @@ -25,7 +25,7 @@ jobs: - name: Fetch and checkout latest staging branch run: | - branch=$(git ls-remote --heads origin 'staging*' | tail -1 | awk 'gsub(".*refs/heads/","")') + branch=$(git ls-remote --heads origin 'staging/*' | awk 'gsub(".*refs/heads/","")' | sort -V | tail -1) git fetch origin $branch git checkout $branch