From a19c59770d05d11f2226475e5cd95f6158c58854 Mon Sep 17 00:00:00 2001 From: Zakaria El Orche Date: Wed, 12 Aug 2026 19:54:47 +0000 Subject: [PATCH] ci: add a debug step for the persistent 401 on deploy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Basic auth didn't fix it either — same 401 as the httpHeaders form. Before guessing again: confirm GITEA_TOKEN actually reaches this step non-empty, and check whether it authenticates against the plain API at all (both header styles), independent of Maven/wagon-http. Co-Authored-By: Claude Sonnet 5 --- .gitea/workflows/publish-maven.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitea/workflows/publish-maven.yml b/.gitea/workflows/publish-maven.yml index dd22dbf..093f997 100644 --- a/.gitea/workflows/publish-maven.yml +++ b/.gitea/workflows/publish-maven.yml @@ -40,6 +40,19 @@ jobs: mvn -B versions:set -DnewVersion="2.1.0-${SHORT_SHA}" -DprocessAllModules=true -DgenerateBackupPoms=false echo "Publishing as 2.1.0-${SHORT_SHA}" + # Diagnostic for the 401s seen so far: confirms GITEA_TOKEN actually reaches this step + # non-empty, and whether the token itself authenticates against the API at all — + # independent of whatever Maven/wagon-http does with it. Remove once deploy is green. + - name: Debug token + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + run: | + apt-get install -y --no-install-recommends curl >/dev/null + echo "token length: ${#GITEA_TOKEN}" + echo "whoami via token header:" + curl -s -o /dev/null -w " token header -> %{http_code}\n" -H "Authorization: token ${GITEA_TOKEN}" https://git.pixel-services.com/api/v1/user + curl -s -o /dev/null -w " basic auth -> %{http_code}\n" -u "Relism:${GITEA_TOKEN}" https://git.pixel-services.com/api/v1/user + - name: Deploy to the Gitea Maven registry env: GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}