From a3a284ab2d51141b3744db725a57ad33cc69fdcb Mon Sep 17 00:00:00 2001 From: xynydev <60004820+xynydev@users.noreply.github.com> Date: Sat, 2 Mar 2024 19:50:41 +0200 Subject: [PATCH 1/2] feat: allow using unstable cli --- action.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index f83ef15..5b2d679 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}} From 4ef539190709fb94d03ab5c1ceb757a239b67fb0 Mon Sep 17 00:00:00 2001 From: xynydev <60004820+xynydev@users.noreply.github.com> Date: Sat, 2 Mar 2024 19:51:13 +0200 Subject: [PATCH 2/2] style: add spaces in github template syntax vars to differentiate them from bash --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 5b2d679..31e2ab8 100644 --- a/action.yml +++ b/action.yml @@ -86,5 +86,5 @@ runs: --device /dev/fuse \ 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 }}