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:
@ -17,22 +17,13 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.giteatoken }}
|
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
|
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
|
||||||
if [ ! -f "Cargo.toml" ]; then
|
echo "Downloading archive from $REPO_URL ..."
|
||||||
rm -rf .git 2>/dev/null || true
|
curl -sfL "$REPO_URL" -o repo.tar.gz
|
||||||
if [ -n "$GITEA_TOKEN" ]; then
|
tar -xzf repo.tar.gz --strip-components=1
|
||||||
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
|
rm -f repo.tar.gz
|
||||||
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"
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
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
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.giteatoken }}
|
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
|
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
|
||||||
if [ ! -f "Cargo.toml" ]; then
|
echo "Downloading archive from $REPO_URL ..."
|
||||||
rm -rf .git 2>/dev/null || true
|
curl -sfL "$REPO_URL" -o repo.tar.gz
|
||||||
if [ -n "$GITEA_TOKEN" ]; then
|
tar -xzf repo.tar.gz --strip-components=1
|
||||||
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
|
rm -f repo.tar.gz
|
||||||
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"
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
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
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.giteatoken }}
|
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
|
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
|
||||||
if [ ! -f "Cargo.toml" ]; then
|
echo "Downloading archive from $REPO_URL ..."
|
||||||
rm -rf .git 2>/dev/null || true
|
curl -sfL "$REPO_URL" -o repo.tar.gz
|
||||||
if [ -n "$GITEA_TOKEN" ]; then
|
tar -xzf repo.tar.gz --strip-components=1
|
||||||
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
|
rm -f repo.tar.gz
|
||||||
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"
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
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
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.giteatoken }}
|
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
|
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
|
||||||
if [ ! -f "Cargo.toml" ]; then
|
echo "Downloading archive from $REPO_URL ..."
|
||||||
rm -rf .git 2>/dev/null || true
|
curl -sfL "$REPO_URL" -o repo.tar.gz
|
||||||
if [ -n "$GITEA_TOKEN" ]; then
|
tar -xzf repo.tar.gz --strip-components=1
|
||||||
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
|
rm -f repo.tar.gz
|
||||||
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"
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
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
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.giteatoken }}
|
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
|
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
|
||||||
if [ ! -f "Cargo.toml" ]; then
|
echo "Downloading archive from $REPO_URL ..."
|
||||||
rm -rf .git 2>/dev/null || true
|
curl -sfL "$REPO_URL" -o repo.tar.gz
|
||||||
if [ -n "$GITEA_TOKEN" ]; then
|
tar -xzf repo.tar.gz --strip-components=1
|
||||||
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
|
rm -f repo.tar.gz
|
||||||
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"
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
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
|
runs-on: fedora
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.giteatoken }}
|
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
|
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
|
||||||
if [ ! -f "Cargo.toml" ]; then
|
echo "Downloading archive from $REPO_URL ..."
|
||||||
rm -rf .git 2>/dev/null || true
|
curl -sfL "$REPO_URL" -o repo.tar.gz
|
||||||
if [ -n "$GITEA_TOKEN" ]; then
|
tar -xzf repo.tar.gz --strip-components=1
|
||||||
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
|
rm -f repo.tar.gz
|
||||||
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"
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
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
|
runs-on: alpine
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.giteatoken }}
|
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
|
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
|
||||||
if [ ! -f "Cargo.toml" ]; then
|
echo "Downloading archive from $REPO_URL ..."
|
||||||
rm -rf .git 2>/dev/null || true
|
curl -sfL "$REPO_URL" -o repo.tar.gz
|
||||||
if [ -n "$GITEA_TOKEN" ]; then
|
tar -xzf repo.tar.gz --strip-components=1
|
||||||
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
|
rm -f repo.tar.gz
|
||||||
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"
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
apk add --no-cache curl bash
|
apk add --no-cache curl bash
|
||||||
@ -286,22 +223,13 @@ jobs:
|
|||||||
runs-on: arch
|
runs-on: arch
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.giteatoken }}
|
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git"
|
REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz"
|
||||||
if [ ! -f "Cargo.toml" ]; then
|
echo "Downloading archive from $REPO_URL ..."
|
||||||
rm -rf .git 2>/dev/null || true
|
curl -sfL "$REPO_URL" -o repo.tar.gz
|
||||||
if [ -n "$GITEA_TOKEN" ]; then
|
tar -xzf repo.tar.gz --strip-components=1
|
||||||
git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" .
|
rm -f repo.tar.gz
|
||||||
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"
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
||||||
|
|||||||
Reference in New Issue
Block a user