ci: 检出兼容 AGit PR 的 refs/pull/N/head(clone --branch 只认分支名,改为 fetch 后 checkout)
CI / test (pull_request) Successful in 1m6s
CI / test (pull_request) Successful in 1m6s
This commit is contained in:
@@ -12,7 +12,10 @@ jobs:
|
|||||||
- name: 检出代码
|
- name: 检出代码
|
||||||
run: |
|
run: |
|
||||||
REF="${{ github.event.pull_request.head.ref || github.ref_name }}"
|
REF="${{ github.event.pull_request.head.ref || github.ref_name }}"
|
||||||
git clone --depth 1 --branch "$REF" "${{ github.server_url }}/${{ github.repository }}.git" .
|
git clone --depth 1 "${{ github.server_url }}/${{ github.repository }}.git" .
|
||||||
|
# PR head 可能是完整 ref(AGit 建的 PR 为 refs/pull/N/head),clone --branch 只认分支名,改 fetch 后 checkout
|
||||||
|
git fetch --depth 1 origin "$REF"
|
||||||
|
git checkout --detach FETCH_HEAD
|
||||||
- name: 安装 uv
|
- name: 安装 uv
|
||||||
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
- name: 安装依赖
|
- name: 安装依赖
|
||||||
|
|||||||
Reference in New Issue
Block a user