From 229504e5e1755dbd7b800a074f9800d88a46fc85 Mon Sep 17 00:00:00 2001 From: xyny <60004820+xynydev@users.noreply.github.com> Date: Sun, 3 Mar 2024 10:55:00 +0000 Subject: [PATCH] feat: add input to use unstable cli (#17) (#26) * feat: allow using unstable cli * style: add spaces in github template syntax vars to differentiate them from bash --- action.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index f83ef15..31e2ab8 100644 --- a/action.yml +++ b/action.yml @@ -31,6 +31,13 @@ inputs: Input must match the string 'true' for the step to be enabled. required: false default: 'false' + use_unstable_cli: + description: | + If true, this action pulls the `main` branch of blue-build/cli instead of the stable version the current action version is configured to use by default. + This feature is useful for testing new features, but should not be used in production. + Input must match the string 'true' for the unstable version to be used. + required: false + default: 'false' registry: description: | The container registry to push the built image to. @@ -67,15 +74,17 @@ runs: COSIGN_PRIVATE_KEY: ${{ inputs.cosign_private_key }} GH_TOKEN: ${{ inputs.registry_token }} GH_PR_EVENT_NUMBER: ${{ inputs.pr_event_number }} + # Uses GitHubs ternary syntax to set cli version, see https://docs.github.com/en/actions/learn-github-actions/expressions#example + CLI_VERSION_TAG: ${{ inputs.use_unstable_cli == 'true' && 'main' || 'v0.8.1' }}}} run: | podman run \ -v buildah-vol:/var/run/containerd \ - -v $PWD:/bluebuild \ + -v ${PWD}:/bluebuild \ --env-host \ --network=host \ --privileged \ --device /dev/fuse \ - ghcr.io/blue-build/cli:v0.8.1-alpine \ + ghcr.io/blue-build/cli:${CLI_VERSION_TAG}-alpine \ build -vv --push ./config/${{ inputs.recipe }} \ - --registry ${{inputs.registry}} \ - --registry-namespace ${{inputs.registry_namespace}} + --registry ${{ inputs.registry }} \ + --registry-namespace ${{ inputs.registry_namespace }}