From 91ad95da3fc3d7c3b943d4f8a99d8d0e82b5c487 Mon Sep 17 00:00:00 2001 From: Gerald Pinder Date: Fri, 31 May 2024 07:38:47 -0400 Subject: [PATCH] feat: Add support for specifying a specific version of the CLI (#51) * feat: Add support for specifying a specific version of the CLI * Print version --- action.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 195cfd0..15da4ed 100644 --- a/action.yml +++ b/action.yml @@ -44,6 +44,10 @@ inputs: Input must match the string 'true' for the unstable version to be used. required: false default: 'false' + cli_version: + description: | + Set this with a tag, sha, or branch name for the blue-build/cli repo to use that particular version of the CLI tool. This will override the `use_unstable_cli` input for the action. + required: false registry: description: | The container registry to push the built image to. @@ -119,8 +123,10 @@ runs: env: RECIPE: ${{ inputs.recipe }} run: | - if [[ "${{ inputs.use_unstable_cli }}" == "true" ]]; then + if [[ "${{ inputs.use_unstable_cli }}" == "true" && -z "${{ inputs.cli_version }}" ]]; then CLI_VERSION_TAG="main" + elif [ -n "${{ inputs.cli_version }}" ]; then + CLI_VERSION_TAG="${{ inputs.cli_version }}" else CLI_VERSION_TAG="v0.8" fi @@ -144,6 +150,7 @@ runs: ghcr.io/blue-build/cli:${{ env.CLI_VERSION_TAG }}-installer docker cp blue-build-installer:/out/bluebuild /usr/local/bin/bluebuild docker rm blue-build-installer + bluebuild --version # Required in order for docker buildx to # take advantage of the GHA cache API