Skip to content

Commit b602566

Browse files
committed
fix: use git ls-remote to detect stable branches
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com> Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent fc10ded commit b602566

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/generate-top-index.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Get stable branches
2929
id: branch
3030
run: |
31-
branches=$(git branch -r | grep -E 'origin/stable[0-9]+' | sed 's/.*stable//' | sort -n -r | tr '\n' ' ')
31+
branches=$(git ls-remote --heads origin "heads/stable[0-9][0-9]"| awk '{gsub(/^refs\/heads\/stable/, "", $2); print $2}' | sort -n -r | tr '\n' ' ')
3232
echo "branches=$branches" >> $GITHUB_OUTPUT
3333
3434
- name: Setup php

.github/workflows/sphinxbuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
current_branch="${GITHUB_REF#refs/heads/}"
120120
121121
# Find the highest numbered stable branch
122-
highest_stable=$(git branch -r | grep -E 'origin/stable[0-9]+' | sed 's/.*stable//' | sort -n | tail -1)
122+
highest_stable=$(git ls-remote --heads origin 'heads/stable[0-9][0-9]' | sed 's?.*refs/heads/stable??' | sort -n | tail -1)
123123
highest_stable_branch="stable${highest_stable}"
124124
125125
echo "Current branch: $current_branch"

0 commit comments

Comments
 (0)