From 6298ec325f151159b842b1eceadfb4eb70223082 Mon Sep 17 00:00:00 2001
From: Fabio <fabiorauber@gmail.com>
Date: Fri, 4 Apr 2025 16:34:26 -0300
Subject: [PATCH] Fail if GITEATOKEN is not set

---
 .drone.yml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/.drone.yml b/.drone.yml
index 2b156a2..69ad512 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -47,9 +47,8 @@ steps:
   - name: push-to-branch
     image: alpine/git
     commands:
-      # Debug: Verify API key presence
-      - "test -n \"$GITEATOKEN\" || { echo \"GITEATOKEN is not set\"; exit 1; }"
-      - "echo \"Key: ${GITEATOKEN}\""
+      # Fail explicitly if GITEA_API_KEY is unset or empty
+      - "if [ -z \"$GITEATOKEN\" ]; then echo \"Error: GITEATOKEN is not set or empty\"; exit 1; fi"
       # Check if gh-pages exists remotely, fetch it if it does, otherwise create it
       - git ls-remote --heads origin gh-pages | grep -q gh-pages && git fetch origin gh-pages && git checkout gh-pages || git checkout -b gh-pages
       # Stage the charts/dist directory (already in the working directory)