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:
@@ -25,10 +25,13 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
env:
|
env:
|
||||||
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
||||||
|
DEPLOY_REF: ${{ inputs.ref }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
find . -mindepth 1 -delete
|
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" .
|
"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
|
git remote set-url origin http://172.24.0.2:3000/BPPP/smb-online.git
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user