From c7466a2fe8200a59220e41156ce0a8ef116df0a1 Mon Sep 17 00:00:00 2001 From: giles Date: Mon, 23 Feb 2026 23:31:57 +0000 Subject: [PATCH] Fix CI: use github.ref_name for branch in SSH command GITHUB_REF wasn't available inside the remote SSH session. Use Gitea's template interpolation instead. Co-Authored-By: Claude Opus 4.6 --- .gitea/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index daae89c..a79f66e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -30,13 +30,13 @@ jobs: - name: Pull latest code on server env: DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + BRANCH: ${{ github.ref_name }} run: | ssh "root@$DEPLOY_HOST" " - BRANCH="${GITHUB_REF##refs/heads/}" cd /root/art-dag/celery - git fetch origin "$BRANCH" - git checkout "$BRANCH" - git reset --hard "origin/$BRANCH" + git fetch origin $BRANCH + git checkout $BRANCH + git reset --hard origin/$BRANCH " - name: Build and push image