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 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 19:44:44 +02:00
co-authored by Claude Opus 5.5
parent f55707417f
commit b22a398116
+14 -11
View File
@@ -62,14 +62,17 @@ on:
description: Newline-separated KEY=value pairs. description: Newline-separated KEY=value pairs.
type: string type: string
default: "" 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: push:
description: Push the image. Pass false for pull requests. description: Push the image, "true" or "false". Pass false for pull requests.
type: boolean type: string
default: true default: "true"
cache: cache:
description: Keep the layer cache in Harbor as <image>:buildcache. description: Keep the layer cache in Harbor as <image>:buildcache, "true" or "false".
type: boolean type: string
default: false default: "false"
secrets: secrets:
registry-username: registry-username:
required: false required: false
@@ -140,14 +143,14 @@ jobs:
uses: docker/setup-qemu-action@v4 uses: docker/setup-qemu-action@v4
- uses: docker/setup-buildx-action@v4 - uses: docker/setup-buildx-action@v4
- if: inputs.push - if: inputs.push == 'true'
uses: docker/login-action@v4 uses: docker/login-action@v4
with: with:
registry: ${{ inputs.registry }} registry: ${{ inputs.registry }}
username: ${{ secrets.registry-username }} username: ${{ secrets.registry-username }}
password: ${{ secrets.registry-token }} password: ${{ secrets.registry-token }}
- if: inputs.push && env.DOCKERHUB == 'true' - if: inputs.push == 'true' && env.DOCKERHUB == 'true'
uses: docker/login-action@v4 uses: docker/login-action@v4
with: with:
username: ${{ secrets.dockerhub-username }} username: ${{ secrets.dockerhub-username }}
@@ -158,9 +161,9 @@ jobs:
context: ${{ inputs.context }} context: ${{ inputs.context }}
file: ${{ inputs.dockerfile || format('{0}/Dockerfile', inputs.context) }} file: ${{ inputs.dockerfile || format('{0}/Dockerfile', inputs.context) }}
platforms: ${{ inputs.platforms }} platforms: ${{ inputs.platforms }}
push: ${{ inputs.push }} push: ${{ inputs.push == 'true' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
build-args: ${{ inputs.build-args }} build-args: ${{ inputs.build-args }}
cache-from: ${{ inputs.cache && format('type=registry,ref={0}:buildcache', env.IMAGE) || '' }} cache-from: ${{ inputs.cache == 'true' && 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-to: ${{ inputs.cache == 'true' && inputs.push == 'true' && format('type=registry,ref={0}:buildcache,mode=max,image-manifest=true,oci-mediatypes=true', env.IMAGE) || '' }}