diff --git a/action.yaml b/action.yaml index d33403b..f769bb6 100644 --- a/action.yaml +++ b/action.yaml @@ -18,6 +18,10 @@ inputs: description: "The working directory to run the deploy from. Defaults to the root of the repository." required: false default: "." + launchflow_cli_version: + description: "The version of the LaunchFlow CLI to use. Defaults to the latest version." + required: false + default: "" branding: icon: "cloud" color: "purple" @@ -31,4 +35,5 @@ runs: INPUT_TO_ENVIRONMENT: ${{ inputs.to_environment_name }} INPUT_PROJECT_ID: ${{ inputs.project_id }} INPUT_DKEY: ${{ inputs.deployment_key }} + INPUT_CLI_VERSION: ${{ inputs.launchflow_cli_version }} shell: bash diff --git a/action/main.py b/action/main.py index 4e6eebe..1f87b35 100644 --- a/action/main.py +++ b/action/main.py @@ -1,4 +1,4 @@ -"""GitHub Action for Ruff.""" +"""GitHub Action for LaunchFlow Promot.""" import os import re import sys @@ -9,15 +9,12 @@ TO_ENVIRONMENT = os.environ["INPUT_TO_ENVIRONMENT"] PROJECT = os.environ["INPUT_PROJECT_ID"] DKEY = os.environ["INPUT_DKEY"] +CLI_VERSION = os.getenv("INPUT_CLI_VERSION", None) -version_specifier = "" -if VERSION != "": - if not re.match(r"v?\d\.\d{1,3}\.\d{1,3}$", VERSION): - print("VERSION does not match expected pattern") - sys.exit(1) - version_specifier = f"=={VERSION}" - -req = f"ruff{version_specifier}" +if CLI_VERSION is not None: + cmd = f"pip install launchflow=={CLI_VERSION}" +else: + cmd = "pip install launchflow" cmd = "pip install launchflow" check_call(cmd, shell=True)