From f2e10dab53987902295a98a3b0c5d27ec036504e Mon Sep 17 00:00:00 2001 From: Seyed Yahya Shirazi Date: Mon, 8 Jun 2026 11:35:25 -0700 Subject: [PATCH] fix(ci): make sync-develop check out develop by explicit ref The post-release sync failed on every release (through v0.8.4) at the checkout step: under the workflow_run trigger, actions/checkout's wildcard fetch (+refs/heads/*) intermittently advertised only main, so ref: develop raised 'a branch or tag with the name develop could not be found'. Check out main (always advertised) and fetch develop by explicit name, which requests the ref directly and is reliable. --- .github/workflows/sync-develop.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-develop.yml b/.github/workflows/sync-develop.yml index 337ec2b..7003994 100644 --- a/.github/workflows/sync-develop.yml +++ b/.github/workflows/sync-develop.yml @@ -30,15 +30,27 @@ jobs: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - - name: Checkout develop + # Check out main, not develop: under the workflow_run trigger the + # checkout action's wildcard fetch (+refs/heads/*) intermittently + # advertises only `main`, so `ref: develop` fails with "a branch or tag + # with the name 'develop' could not be found" (broke every release through + # v0.8.4). main is always advertised; we fetch develop by explicit name + # in the next step, which requests the ref directly and is reliable. + - name: Checkout main uses: actions/checkout@v4 with: - ref: develop + ref: main fetch-depth: 0 # CI_ADMIN_TOKEN lets this push to develop without tripping # branch protection (same pattern as ensure-stable-version.yml). token: ${{ secrets.CI_ADMIN_TOKEN }} + - name: Check out develop by explicit ref + run: | + git fetch origin +refs/heads/develop:refs/remotes/origin/develop + git checkout -B develop refs/remotes/origin/develop + git log --oneline -1 + - name: Set up Python uses: actions/setup-python@v5 with: