From 9ecdfe7cd1eb75ff6fbabdb69882092bc92a5ba0 Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 24 Apr 2026 10:23:49 -0400 Subject: [PATCH] Strip scheme from REGISTRY_URL before tagging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docker image tags must start with a hostname — a `https://` prefix in the REGISTRY_URL variable produced `invalid reference format`. Normalize the value in a prep step (drop http/https scheme and trailing slash) so the workflow works whether the variable is set as a URL or a bare host. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/build-push.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build-push.yml b/.gitea/workflows/build-push.yml index 0f56d0d..c58e591 100644 --- a/.gitea/workflows/build-push.yml +++ b/.gitea/workflows/build-push.yml @@ -14,9 +14,15 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Compute short SHA + - name: Prepare build vars id: vars - run: echo "sha_short=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT" + run: | + host="${{ vars.REGISTRY_URL }}" + host="${host#https://}" + host="${host#http://}" + host="${host%/}" + echo "registry=$host" >> "$GITHUB_OUTPUT" + echo "sha_short=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -24,7 +30,7 @@ jobs: - name: Login to Gitea registry uses: docker/login-action@v3 with: - registry: ${{ vars.REGISTRY_URL }} + registry: ${{ steps.vars.outputs.registry }} username: ${{ gitea.actor }} password: ${{ secrets.REGISTRY_TOKEN }} @@ -34,5 +40,5 @@ jobs: context: . push: true tags: | - ${{ vars.REGISTRY_URL }}/${{ env.IMAGE }}:latest - ${{ vars.REGISTRY_URL }}/${{ env.IMAGE }}:sha-${{ steps.vars.outputs.sha_short }} + ${{ steps.vars.outputs.registry }}/${{ env.IMAGE }}:latest + ${{ steps.vars.outputs.registry }}/${{ env.IMAGE }}:sha-${{ steps.vars.outputs.sha_short }}