From 2da87f1c7872e7b16f32425c5a22af664b937540 Mon Sep 17 00:00:00 2001 From: Philipp Traber Date: Fri, 16 Oct 2026 19:44:44 +0200 Subject: [PATCH] pass push and cache as strings Every boolean input of a called workflow reaches the job as false on Gitea 1.27 with gitea/runner v2.0.1, so push never happened while the job still succeeded. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/image.yaml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/image.yaml b/.gitea/workflows/image.yaml index ac43a3f..90ad66d 100644 --- a/.gitea/workflows/image.yaml +++ b/.gitea/workflows/image.yaml @@ -62,14 +62,17 @@ on: description: Newline-separated KEY=value pairs. type: string default: "" + # push and cache are "true"/"false" strings, not booleans: on Gitea 1.27 with + # gitea/runner v2.0.1 every boolean input of a called workflow arrives as false + # (the runner compares Gitea's native true against the string "true"). push: - description: Push the image. Pass false for pull requests. - type: boolean - default: true + description: Push the image, "true" or "false". Pass false for pull requests. + type: string + default: "true" cache: - description: Keep the layer cache in Harbor as :buildcache. - type: boolean - default: false + description: Keep the layer cache in Harbor as :buildcache, "true" or "false". + type: string + default: "false" secrets: registry-username: required: false @@ -140,14 +143,14 @@ jobs: uses: docker/setup-qemu-action@v4 - uses: docker/setup-buildx-action@v4 - - if: inputs.push + - if: inputs.push == 'true' uses: docker/login-action@v4 with: registry: ${{ inputs.registry }} username: ${{ secrets.registry-username }} password: ${{ secrets.registry-token }} - - if: inputs.push && env.DOCKERHUB == 'true' + - if: inputs.push == 'true' && env.DOCKERHUB == 'true' uses: docker/login-action@v4 with: username: ${{ secrets.dockerhub-username }} @@ -158,9 +161,9 @@ jobs: context: ${{ inputs.context }} file: ${{ inputs.dockerfile || format('{0}/Dockerfile', inputs.context) }} platforms: ${{ inputs.platforms }} - push: ${{ inputs.push }} + push: ${{ inputs.push == 'true' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: ${{ inputs.build-args }} - cache-from: ${{ inputs.cache && format('type=registry,ref={0}:buildcache', env.IMAGE) || '' }} - cache-to: ${{ inputs.cache && inputs.push && format('type=registry,ref={0}:buildcache,mode=max,image-manifest=true,oci-mediatypes=true', env.IMAGE) || '' }} + cache-from: ${{ inputs.cache == 'true' && format('type=registry,ref={0}:buildcache', env.IMAGE) || '' }} + cache-to: ${{ inputs.cache == 'true' && inputs.push == 'true' && format('type=registry,ref={0}:buildcache,mode=max,image-manifest=true,oci-mediatypes=true', env.IMAGE) || '' }}