fix: use branch-based shallow clone in CI to avoid missing SHA
Clone with -b GITHUB_REF_NAME instead of depth=1 + checkout SHA, which fails when the shallow clone doesn't include the target commit.
This commit is contained in:
parent
a06ce9e156
commit
f2b04ea668
2 changed files with 3 additions and 6 deletions
|
|
@ -44,8 +44,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
apt-get update && apt-get install -y --no-install-recommends \
|
apt-get update && apt-get install -y --no-install-recommends \
|
||||||
git wireguard-tools pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl
|
git wireguard-tools pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl
|
||||||
git clone --depth=1 ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git .
|
git clone --depth=1 -b "${GITHUB_REF_NAME}" ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git .
|
||||||
git checkout ${GITHUB_SHA}
|
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
run: pip install uv
|
run: pip install uv
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
apt-get update && apt-get install -y --no-install-recommends \
|
apt-get update && apt-get install -y --no-install-recommends \
|
||||||
git wireguard-tools pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl
|
git wireguard-tools pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl
|
||||||
git clone --depth=1 ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git .
|
git clone --depth=1 -b "${GITHUB_REF_NAME}" ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git .
|
||||||
git checkout ${GITHUB_SHA}
|
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
run: pip install uv
|
run: pip install uv
|
||||||
|
|
@ -208,8 +207,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
run: |
|
run: |
|
||||||
git clone --depth=1 ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git .
|
git clone --depth=1 -b "${GITHUB_REF_NAME}" ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git .
|
||||||
git checkout ${GITHUB_SHA}
|
|
||||||
|
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue