From e589e8711a5c28175adfe9ecf7e78a3f6c641bd0 Mon Sep 17 00:00:00 2001 From: Cliff Hill Date: Sun, 26 Oct 2025 07:01:35 -0400 Subject: [PATCH] Fixing errors in the yaml file. Signed-off-by: Cliff Hill --- .gitea/workflows/tests.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 47350dd..12759c2 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -29,7 +29,8 @@ jobs: env | grep -i runner || echo "No runner-related env vars found" echo "=== Gitea Context Variables ===" - echo "Available context: ${{ toJSON(gitea) }}" + echo "GITHUB_WORKSPACE: ${GITHUB_WORKSPACE}" + echo "GITHUB_SHA: ${GITHUB_SHA}" # Detect runner name from environment variables RUNNER_NAME="${GITEA_RUNNER_NAME:-${HOSTNAME:-${RUNNER_NAME:-${ACT_RUNNER_NAME:-unknown}}}}" @@ -42,9 +43,14 @@ jobs: - name: Checkout code (manual - more reliable than actions/checkout) # Skip actions/checkout@v4 due to SSL issues with dogar.darkhelm.org # Use manual checkout with multiple fallback methods + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + GITHUB_WORKSPACE: ${{ github.workspace }} + GITHUB_SHA: ${{ github.sha }} run: | echo "=== Repository Checkout ===" - cd ${{ github.workspace }} + cd "${GITHUB_WORKSPACE}" # Ensure clean workspace rm -rf ./* .git 2>/dev/null || true @@ -73,10 +79,10 @@ jobs: echo "=== SSH Key Setup ===" # Use SSH key from Gitea repository secret (recommended approach) - if [ -n "${{ secrets.SSH_PRIVATE_KEY }}" ]; then + if [ -n "${SSH_PRIVATE_KEY}" ]; then echo "Setting up SSH key from Gitea repository secret" mkdir -p ~/.ssh - echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + echo "${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa echo "SSH private key installed from repository secret" ls -la ~/.ssh/ @@ -106,7 +112,7 @@ jobs: elif echo "Trying internal HTTP (gitea:3000)..." && git clone --depth 1 --branch main http://gitea:3000/DarkHelm.org/plex-playlist.git . 2>&1; then echo "✓ Internal HTTP clone successful (kankali-runner only)" # Method 4: HTTPS with token (for private repo access) - elif echo "Trying HTTPS with token..." && git -c http.sslVerify=false clone --depth 1 --branch main "https://token:${{ secrets.GITEA_TOKEN }}@dogar.darkhelm.org/DarkHelm.org/plex-playlist.git" . 2>&1; then + elif [ -n "${GITEA_TOKEN}" ] && echo "Trying HTTPS with token..." && git -c http.sslVerify=false clone --depth 1 --branch main "https://token:${GITEA_TOKEN}@dogar.darkhelm.org/DarkHelm.org/plex-playlist.git" . 2>&1; then echo "✓ External HTTPS clone with token successful" # Method 5: HTTPS with SSL verification disabled (fallback) elif echo "Trying HTTPS with SSL disabled..." && git -c http.sslVerify=false clone --depth 1 --branch main https://dogar.darkhelm.org/DarkHelm.org/plex-playlist.git . 2>&1; then @@ -123,8 +129,8 @@ jobs: fi # Checkout the specific commit if available, otherwise use main - if [ -n "${{ github.sha }}" ]; then - git checkout ${{ github.sha }} 2>/dev/null || echo "Using main branch HEAD" + if [ -n "${GITHUB_SHA}" ]; then + git checkout "${GITHUB_SHA}" 2>/dev/null || echo "Using main branch HEAD" else echo "Using main branch HEAD" fi