Skip to content

Commit c678b73

Browse files
committed
Fix Semaphore stable branch detection
1 parent c6a48b5 commit c678b73

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

semaphoreci.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ export OS_NAME=linux
1919
export FULL_BUILD="${PULL_REQUEST_NUMBER+false}"
2020
# SemaphoreCI doesn't provide a convenient way to the base branch (e.g. master or stable)
2121
if [ -n "${PULL_REQUEST_NUMBER:-}" ]; then
22-
# detect master/stable without querying the rate-limited API
23-
BRANCH="$(git describe --all | sed -E "s/.*\/([^-/]*)-.*/\1/")"
22+
BRANCH=$((curl -fsSL https://api.github.com/repos/dlang/dmd/pulls/$PULL_REQUEST_NUMBER || echo) | jq -r '.base.ref')
2423
# check if the detected branch actually exists and fallback to master
2524
if ! git ls-remote --exit-code --heads https://github.com/dlang/dmd.git "$BRANCH" > /dev/null ; then
2625
echo "Invalid branch detected: ${BRANCH} - falling back to master"

0 commit comments

Comments
 (0)