From 2b62070557283c1710c6f68a3486865eea156579 Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Sun, 16 Aug 2026 11:11:17 +0200 Subject: [PATCH] Give gem push a named credentials key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The push prompted for credentials and then died with "404 page not found". Both are the same fault: RubyGems normalizes the keys in ~/.gem/credentials — dots become __ and a trailing slash is appended — so a key written as the host URL can never match the --host value. Finding no key, gem push falls back to signing in against the RubyGems sign_in endpoint, which Gitea does not implement; that is the 404. A named key is stored verbatim and is matched by --key, so the lookup succeeds. Verified against Gem::ConfigFile with both formats. Co-Authored-By: Claude Opus 5 (1M context) --- .woodpecker.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yaml b/.woodpecker.yaml index c7cc0e5..730f7f6 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -48,10 +48,15 @@ steps: - gem build warp_engine.gemspec - mkdir -p ~/.gem - TOKEN="$$(printf '%s' "$${FORGE_TOKEN}" | tr -d '[:space:]')" + # Nevesített kulcs, nem a hoszt-URL: a RubyGems a credentials fájl + # kulcsait normalizálja (a pontokból __ lesz, záró perjelet kap), így egy + # URL-kulcs sosem egyezik a --host értékével. Ilyenkor a gem push + # bejelentkezni próbál a RubyGems sign_in végpontján, amit a Gitea nem + # ismer — ez adta a "404 page not found"-ot. - | - printf -- '---\n:https://git.teletypegames.org/api/packages/engines/rubygems: Bearer %s\n' "$${TOKEN}" > ~/.gem/credentials + printf -- '---\n:gitea: Bearer %s\n' "$${TOKEN}" > ~/.gem/credentials - chmod 600 ~/.gem/credentials - - gem push --host https://git.teletypegames.org/api/packages/engines/rubygems warp_engine-*.gem + - gem push --key gitea --host https://git.teletypegames.org/api/packages/engines/rubygems warp_engine-*.gem when: - event: tag ref: refs/tags/warp_engine-v*