From abe68af124bfa6d10235299f77d6ad29ccc12f69 Mon Sep 17 00:00:00 2001 From: Michael Schiemer Date: Mon, 24 Nov 2025 21:54:27 +0100 Subject: [PATCH] fix(ci): replace actions/checkout with manual git checkout The Gitea Actions Runner doesn't have Node.js installed, causing actions/checkout@v3 (a JavaScript action) to fail with "Cannot find: node in PATH". Replace with native shell-based git checkout that works without Node.js and uses Gitea context variables for repository URL. --- .gitea/workflows/deploy.yml | 11 ++++++++++- .gitea/workflows/test-runner.yml | 27 +++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 59ff66fa..4876d81a 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -11,8 +11,17 @@ jobs: deploy: runs-on: self-hosted steps: + # Manual checkout - works without Node.js - name: Checkout code - uses: actions/checkout@v3 + run: | + echo "📥 Checking out repository..." + if [ -d ".git" ]; then + git fetch origin + git checkout ${{ github.ref_name }} + git reset --hard origin/${{ github.ref_name }} + else + git clone --branch ${{ github.ref_name }} --single-branch ${{ github.server_url }}/${{ github.repository }}.git . + fi - name: Determine environment id: env diff --git a/.gitea/workflows/test-runner.yml b/.gitea/workflows/test-runner.yml index 90fb877b..0ac3cc68 100644 --- a/.gitea/workflows/test-runner.yml +++ b/.gitea/workflows/test-runner.yml @@ -11,22 +11,41 @@ jobs: test-basic: runs-on: self-hosted steps: + # Manual checkout - works without Node.js - name: Checkout code - uses: actions/checkout@v3 + run: | + echo "📥 Checking out repository..." + if [ -d ".git" ]; then + git fetch origin + git checkout ${{ github.ref_name }} + git reset --hard origin/${{ github.ref_name }} + else + git clone --branch ${{ github.ref_name }} --single-branch ${{ github.server_url }}/${{ github.repository }}.git . + fi - name: Test basic runner run: | echo "✅ Runner is working!" echo "Runner OS: $(uname -a)" - echo "Docker version: $(docker --version)" + echo "Docker version: $(docker --version || echo 'Docker not available')" echo "Current directory: $(pwd)" echo "Git branch: $(git rev-parse --abbrev-ref HEAD)" + echo "Git commit: $(git rev-parse --short HEAD)" test-php: runs-on: php-ci steps: + # Manual checkout - works without Node.js - name: Checkout code - uses: actions/checkout@v3 + run: | + echo "📥 Checking out repository..." + if [ -d ".git" ]; then + git fetch origin + git checkout ${{ github.ref_name }} + git reset --hard origin/${{ github.ref_name }} + else + git clone --branch ${{ github.ref_name }} --single-branch ${{ github.server_url }}/${{ github.repository }}.git . + fi - name: Test PHP environment run: | @@ -34,5 +53,5 @@ jobs: php -v composer --version echo "PHP Extensions:" - php -m | grep -E "(pdo|redis|zip|gd|mbstring)" + php -m | grep -E "(pdo|redis|zip|gd|mbstring)" || echo "Some extensions not found"