Fix deploy pipeline: strip refs/heads/ prefix from dispatch ref input

inputs.ref resolves fully-qualified (refs/heads/main) rather than the
declared default "main", so git clone --branch was failing with
"Remote branch refs/heads/main not found".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 18:28:00 +02:00
parent 6b7d47fa4c
commit 0c2e4450f2
+4 -1
View File
@@ -25,10 +25,13 @@ jobs:
- name: Checkout
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
DEPLOY_REF: ${{ inputs.ref }}
run: |
set -euo pipefail
find . -mindepth 1 -delete
git clone --depth 1 --branch "${{ inputs.ref }}" \
# inputs.ref comes through fully-qualified (refs/heads/main), not "main"
BRANCH="${DEPLOY_REF#refs/heads/}"
git clone --depth 1 --branch "$BRANCH" \
"http://${DEPLOY_TOKEN}@172.24.0.2:3000/BPPP/smb-online.git" .
git remote set-url origin http://172.24.0.2:3000/BPPP/smb-online.git