From 818785ec3a643ea053fb34eb2325a38fb8ef0d32 Mon Sep 17 00:00:00 2001 From: David Folkes Date: Mon, 2 Feb 2026 11:12:46 -0500 Subject: [PATCH] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index a896b57..50b0578 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -10,8 +10,33 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: gitea/checkout@v4 + - name: Checkout (manual, from loxthelion.com/gitea) + env: + # If your repo is private, set GITEA_TOKEN as a repo secret (see below). + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + run: | + set -euo pipefail + + # Clean workspace + rm -rf ./* ./.git || true + + # Build clone URL + # GITHUB_SERVER_URL and GITHUB_REPOSITORY are provided by the Actions runtime + BASE="${GITHUB_SERVER_URL%/}" + REPO="${GITHUB_REPOSITORY}" + + # If private repo, use token auth; otherwise unauthenticated clone works + if [ -n "${GITEA_TOKEN:-}" ]; then + # Inject token for HTTPS auth + CLONE_URL="${BASE}/${REPO}.git" + CLONE_URL="$(echo "$CLONE_URL" | sed -E 's#^https://#https://oauth2:'"${GITEA_TOKEN}"'@#')" + git clone "$CLONE_URL" . + else + git clone "${BASE}/${REPO}.git" . + fi + + # Mark as safe directory for CI environments + git config --global --add safe.directory "$PWD" - name: Install Podman run: | @@ -24,9 +49,9 @@ jobs: VERSION="$(cat VERSION | tr -d ' \n')" echo "version=$VERSION" >> $GITHUB_OUTPUT - - name: Registry login + - name: Log in to container registry env: - REGISTRY: ${{ vars.REGISTRY }} + REGISTRY: ${{ vars.REGISTRY }} # e.g. loxthelion.com:5050 or ghcr.io REGISTRY_USER: ${{ secrets.REGISTRY_USER }} REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} run: | @@ -37,7 +62,7 @@ jobs: - name: Build image (multi-tag) env: REGISTRY: ${{ vars.REGISTRY }} - IMAGE: ${{ vars.IMAGE }} + IMAGE: ${{ vars.IMAGE }} # e.g. lyncolnmd/tvj-epg VERSION: ${{ steps.version.outputs.version }} run: | SHORT_SHA="${GITHUB_SHA::7}"