From e150e8e5e73e659c50a4f6ddc09df093dbc004e0 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 20 Apr 2026 09:27:01 +0200 Subject: [PATCH] fix: sanitize branch name for Docker image tags --- .github/workflows/docker.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 784ba43..915b2a9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -45,10 +45,15 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Preparar tag de imagen + run: | + TAG=$(echo "${{ github.ref_name }}" | sed 's/\//-/g') + echo "IMAGE_TAG=$TAG" >> $GITHUB_ENV + - name: Build y Push uses: docker/build-push-action@v6 with: context: . push: true - # Aquí usamos el nombre de la rama dinámicamente - tags: ghcr.io/dsaub/proyecto-mvc:${{ github.ref_name }} \ No newline at end of file + # Sanitizamos el nombre de la rama (reemplazamos / por -) + tags: ghcr.io/dsaub/proyecto-mvc:${{ env.IMAGE_TAG }} \ No newline at end of file