Private
Public Access
1
0

fix: replace git clone with curl+tar for act runner compatibility

The act runner images do not include git. Previous attempt used git clone
which failed with "git: command not found".

- Replace all git clone with curl downloading Gitea archive tarball
- Use tar to extract the archive into the working directory
- No dependency on git for checkout step
This commit is contained in:
2026-04-26 20:52:35 +00:00
parent 5c4c599c3a
commit 5f5a79100f

View File

@ -17,22 +17,13 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
env:
GITEA_TOKEN: ${{ secrets.giteatoken }}
run: |
set -e
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
if [ ! -f "Cargo.toml" ]; then
rm -rf .git 2>/dev/null || true
if [ -n "$GITEA_TOKEN" ]; then
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
else
git clone --depth 1 "$REPO_URL" .
fi
fi
git config --global --add safe.directory "$(pwd)" 2>/dev/null || true
git fetch origin "$GITHUB_SHA" --depth=1
git checkout -f "$GITHUB_SHA"
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
echo "Downloading archive from $REPO_URL ..."
curl -sfL "$REPO_URL" -o repo.tar.gz
tar -xzf repo.tar.gz --strip-components=1
rm -f repo.tar.gz
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
@ -47,22 +38,13 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
env:
GITEA_TOKEN: ${{ secrets.giteatoken }}
run: |
set -e
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
if [ ! -f "Cargo.toml" ]; then
rm -rf .git 2>/dev/null || true
if [ -n "$GITEA_TOKEN" ]; then
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
else
git clone --depth 1 "$REPO_URL" .
fi
fi
git config --global --add safe.directory "$(pwd)" 2>/dev/null || true
git fetch origin "$GITHUB_SHA" --depth=1
git checkout -f "$GITHUB_SHA"
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
echo "Downloading archive from $REPO_URL ..."
curl -sfL "$REPO_URL" -o repo.tar.gz
tar -xzf repo.tar.gz --strip-components=1
rm -f repo.tar.gz
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
@ -81,22 +63,13 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
env:
GITEA_TOKEN: ${{ secrets.giteatoken }}
run: |
set -e
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
if [ ! -f "Cargo.toml" ]; then
rm -rf .git 2>/dev/null || true
if [ -n "$GITEA_TOKEN" ]; then
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
else
git clone --depth 1 "$REPO_URL" .
fi
fi
git config --global --add safe.directory "$(pwd)" 2>/dev/null || true
git fetch origin "$GITHUB_SHA" --depth=1
git checkout -f "$GITHUB_SHA"
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
echo "Downloading archive from $REPO_URL ..."
curl -sfL "$REPO_URL" -o repo.tar.gz
tar -xzf repo.tar.gz --strip-components=1
rm -f repo.tar.gz
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
@ -114,22 +87,13 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
env:
GITEA_TOKEN: ${{ secrets.giteatoken }}
run: |
set -e
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
if [ ! -f "Cargo.toml" ]; then
rm -rf .git 2>/dev/null || true
if [ -n "$GITEA_TOKEN" ]; then
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
else
git clone --depth 1 "$REPO_URL" .
fi
fi
git config --global --add safe.directory "$(pwd)" 2>/dev/null || true
git fetch origin "$GITHUB_SHA" --depth=1
git checkout -f "$GITHUB_SHA"
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
echo "Downloading archive from $REPO_URL ..."
curl -sfL "$REPO_URL" -o repo.tar.gz
tar -xzf repo.tar.gz --strip-components=1
rm -f repo.tar.gz
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
@ -150,22 +114,13 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
env:
GITEA_TOKEN: ${{ secrets.giteatoken }}
run: |
set -e
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
if [ ! -f "Cargo.toml" ]; then
rm -rf .git 2>/dev/null || true
if [ -n "$GITEA_TOKEN" ]; then
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
else
git clone --depth 1 "$REPO_URL" .
fi
fi
git config --global --add safe.directory "$(pwd)" 2>/dev/null || true
git fetch origin "$GITHUB_SHA" --depth=1
git checkout -f "$GITHUB_SHA"
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
echo "Downloading archive from $REPO_URL ..."
curl -sfL "$REPO_URL" -o repo.tar.gz
tar -xzf repo.tar.gz --strip-components=1
rm -f repo.tar.gz
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
@ -193,22 +148,13 @@ jobs:
runs-on: fedora
steps:
- name: Checkout repository
env:
GITEA_TOKEN: ${{ secrets.giteatoken }}
run: |
set -e
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
if [ ! -f "Cargo.toml" ]; then
rm -rf .git 2>/dev/null || true
if [ -n "$GITEA_TOKEN" ]; then
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
else
git clone --depth 1 "$REPO_URL" .
fi
fi
git config --global --add safe.directory "$(pwd)" 2>/dev/null || true
git fetch origin "$GITHUB_SHA" --depth=1
git checkout -f "$GITHUB_SHA"
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
echo "Downloading archive from $REPO_URL ..."
curl -sfL "$REPO_URL" -o repo.tar.gz
tar -xzf repo.tar.gz --strip-components=1
rm -f repo.tar.gz
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
@ -238,22 +184,13 @@ jobs:
runs-on: alpine
steps:
- name: Checkout repository
env:
GITEA_TOKEN: ${{ secrets.giteatoken }}
run: |
set -e
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
if [ ! -f "Cargo.toml" ]; then
rm -rf .git 2>/dev/null || true
if [ -n "$GITEA_TOKEN" ]; then
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
else
git clone --depth 1 "$REPO_URL" .
fi
fi
git config --global --add safe.directory "$(pwd)" 2>/dev/null || true
git fetch origin "$GITHUB_SHA" --depth=1
git checkout -f "$GITHUB_SHA"
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
echo "Downloading archive from $REPO_URL ..."
curl -sfL "$REPO_URL" -o repo.tar.gz
tar -xzf repo.tar.gz --strip-components=1
rm -f repo.tar.gz
- name: Install Rust
run: |
apk add --no-cache curl bash
@ -286,22 +223,13 @@ jobs:
runs-on: arch
steps:
- name: Checkout repository
env:
GITEA_TOKEN: ${{ secrets.giteatoken }}
run: |
set -e
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
if [ ! -f "Cargo.toml" ]; then
rm -rf .git 2>/dev/null || true
if [ -n "$GITEA_TOKEN" ]; then
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
else
git clone --depth 1 "$REPO_URL" .
fi
fi
git config --global --add safe.directory "$(pwd)" 2>/dev/null || true
git fetch origin "$GITHUB_SHA" --depth=1
git checkout -f "$GITHUB_SHA"
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
echo "Downloading archive from $REPO_URL ..."
curl -sfL "$REPO_URL" -o repo.tar.gz
tar -xzf repo.tar.gz --strip-components=1
rm -f repo.tar.gz
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal