diff --git a/.github/actions/release_branch_extraction/action.yml b/.github/actions/release_branch_extraction/action.yml index 9d81e44ba8845d..ba851a5a01a234 100644 --- a/.github/actions/release_branch_extraction/action.yml +++ b/.github/actions/release_branch_extraction/action.yml @@ -35,5 +35,20 @@ runs: id: release_branch_extraction_step shell: bash run: | + # fetch branch information first git fetch origin - git branch -r + + release_branches_ordered_by_version="$(git branch -r | grep origin | grep -o '[^/]*$' | grep 'release-[1-9]\.[0-9]*$' | sort --field-separator '-' --key 2V)" + + newest_release_branch="$(echo $release_branches_ordered_by_version | tail -1 | head -1)" + penultimate_release_branch="$(echo $release_branches_ordered_by_version | tail -2 | head -1)" + antepenultimate_release_branch="$(echo $release_branches_ordered_by_version | tail -3 | head -1)" + + echo "Extracted release branches:" + echo " Branch of newest release: ${newest_release_branch}" + echo " Branch of release that preceded the newest release: ${penultimate_release_branch}" + echo " Branch of that got deprecated most-recently: ${antepenultimate_release_branch}" + + echo "newest_release=${newest_release_branch}" >> ${GITHUB_OUTPUT} + echo "penultimate_release=${penultimate_release_branch}" >> ${GITHUB_OUTPUT} + echo "antepenultimate_release=${antepenultimate_release_branch}" >> ${GITHUB_OUTPUT}