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:
+14
-11
@@ -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 <image>:buildcache.
|
||||
type: boolean
|
||||
default: false
|
||||
description: Keep the layer cache in Harbor as <image>: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) || '' }}
|
||||
|
||||
Reference in New Issue
Block a user