From bdc7499fc1b17b7fea41c54fdb208543deca30d1 Mon Sep 17 00:00:00 2001 From: db123 Date: Tue, 12 May 2026 10:44:44 +0330 Subject: [PATCH] ci: added checkout step to workflow --- .github/workflows/ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae4da49..7968f0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,22 @@ jobs: shell: sh steps: + - name: Checkout repository + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + run: | + set -e + apk add --no-cache git + + GIT_URL="https://${GITEA_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" + git clone --depth 1 --branch "$GITHUB_REF_NAME" "$GIT_URL" . + + if [ "$(git rev-parse HEAD)" != "$GITHUB_SHA" ]; then + echo "Fetching exact commit $GITHUB_SHA..." + git fetch origin "$GITHUB_SHA" --depth 1 + git checkout "$GITHUB_SHA" + fi + - name: Install dependencies run: npm ci --prefer-offline