From 1d1d93f8f041ae809fec2788bfff92d646599608 Mon Sep 17 00:00:00 2001 From: Atlas Date: Wed, 11 Feb 2026 05:19:52 +0000 Subject: [PATCH] fix: use manual git checkout and conditional package managers for Gitea compatibility --- .gitea/workflows/syntax-check.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/syntax-check.yml b/.gitea/workflows/syntax-check.yml index b023c52..a2cd3ac 100644 --- a/.gitea/workflows/syntax-check.yml +++ b/.gitea/workflows/syntax-check.yml @@ -14,14 +14,21 @@ on: jobs: syntax-check: - runs-on: ubuntu-latest + runs-on: linux,x86_64,docker steps: - name: Checkout code - uses: actions/checkout@v3 + run: | + git clone --depth 1 "$(echo "${{ gitea.server_url }}" | sed "s|://|://oauth2:${{ gitea.token }}@|")/${{ gitea.repository }}.git" . + git checkout -q ${{ github.sha }} - name: Install ShellCheck - run: apt-get update && apt-get install -y shellcheck + run: | + if command -v apk >/dev/null 2>&1; then + apk add --no-cache shellcheck + elif command -v apt-get >/dev/null 2>&1; then + apt-get update && apt-get install -y shellcheck + fi - name: Check bash script syntax run: | @@ -30,7 +37,12 @@ jobs: shellcheck example-trigger/deploy.sh - name: Install PHP - run: apt-get install -y php-cli + run: | + if command -v apk >/dev/null 2>&1; then + apk add --no-cache php + elif command -v apt-get >/dev/null 2>&1; then + apt-get install -y php-cli + fi - name: Check PHP syntax run: |