ci(workflow): 替换默认的检出操作为手动实现
Some checks failed
site-dist-deploy / build-and-deploy (push) Failing after 1s
Some checks failed
site-dist-deploy / build-and-deploy (push) Failing after 1s
使用手动实现的git命令替换actions/checkout,以避免Node.js依赖
This commit is contained in:
parent
929e405aab
commit
5082885ace
@ -23,10 +23,19 @@ jobs:
|
||||
build-and-deploy:
|
||||
runs-on: landing-hero-web01
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Manual checkout (no Node required)
|
||||
run: |
|
||||
set -e
|
||||
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
git fetch --all --tags
|
||||
git checkout "${{ github.ref_name }}"
|
||||
git reset --hard "origin/${{ github.ref_name }}"
|
||||
else
|
||||
REPO_URL="${{ github.server_url }}/${{ github.repository }}"
|
||||
echo "Cloning $REPO_URL"
|
||||
git clone --depth=1 --branch "${{ github.ref_name }}" "$REPO_URL" .
|
||||
git fetch --tags
|
||||
fi
|
||||
|
||||
- name: Build dist in Node container
|
||||
run: |
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user