From 30e60c975b99cad6a5cfb40974a436346a9e4e46 Mon Sep 17 00:00:00 2001 From: "Wei (Jack) Sun" Date: Tue, 17 Feb 2026 19:44:32 -0800 Subject: [PATCH] fix(release): use gh api for branch check in release-please git ls-remote fails before checkout since no git repo exists on the runner. Use gh api instead which works without a local repo. --- .github/workflows/release-please.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index e28e251..791d84a 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -20,15 +20,15 @@ jobs: steps: - name: Check if release/candidate still exists id: check + env: + GH_TOKEN: ${{ github.token }} run: | - if git ls-remote --exit-code --heads origin release/candidate &>/dev/null; then + if gh api repos/${{ github.repository }}/branches/release/candidate --silent 2>/dev/null; then echo "exists=true" >> $GITHUB_OUTPUT else echo "release/candidate branch no longer exists, skipping" echo "exists=false" >> $GITHUB_OUTPUT fi - env: - GH_TOKEN: ${{ github.token }} - uses: actions/checkout@v4 if: steps.check.outputs.exists == 'true'