From 5b192bbf2b85a9fed4ca3b8780a6e4fdf1937081 Mon Sep 17 00:00:00 2001 From: Bruno Carvalho de Araujo Date: Wed, 29 Oct 2025 02:42:04 -0300 Subject: [PATCH] Two new optional inputs, `provisioner_tag` and `ignore_lockfile`, to enhance the configurability of the template push process (#14) --- action.yaml | 15 +++++++++++++++ push_template.sh | 14 ++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/action.yaml b/action.yaml index 2fd9a9b..c33e1e8 100644 --- a/action.yaml +++ b/action.yaml @@ -26,14 +26,26 @@ inputs: description: "Marks the current template version as active" required: false default: "true" + provisioner_tag: + description: "Add provisioner tag to the template, useful for identifying the template version in the Coder UI" + required: false + default: "-" message: description: "update message" required: false default: "Updated via update-coder-template action" + organization: + description: "organization name" + required: false + default: "" dry_run: description: "Dry run" required: false default: "false" + ignore_lockfile: + description: "Ignore warnings about not having a .terraform.lock.hcl file present in the template." + required: false + default: "false" runs: using: "composite" @@ -54,3 +66,6 @@ runs: CODER_TEMPLATE_ACTIVATE: ${{ inputs.activate }} CODER_TEMPLATE_MESSAGE: ${{ inputs.message }} CODER_TEMPLATE_DRY_RUN: ${{ inputs.dry_run }} + CODER_PROVISIONER_TAG: ${{ inputs.provisioner_tag }} + CODER_IGNORE_LOCKFILE: ${{ inputs.ignore_lockfile }} + CODER_TEMPLATE_ORGANIZATION: ${{ inputs.organization }} diff --git a/push_template.sh b/push_template.sh index b737481..1656919 100755 --- a/push_template.sh +++ b/push_template.sh @@ -19,6 +19,16 @@ if [ -n "${CODER_TEMPLATE_MESSAGE}" ]; then push_command+=" --message \"${CODER_TEMPLATE_MESSAGE}\"" fi +# Add provisioner tag to the push command if specified +if [ -n "${CODER_PROVISIONER_TAG}" ]; then + push_command+=" --provisioner-tag=\"${CODER_PROVISIONER_TAG}\"" +fi + +# Add organization to the push command if specified +if [ -n "${CODER_TEMPLATE_ORGANIZATION}" ]; then + push_command+=" --org \"${CODER_TEMPLATE_ORGANIZATION}\"" +fi + # Add version to the push command if specified if [ -n "${CODER_TEMPLATE_VERSION_NAME}" ]; then push_command+=" --name ${CODER_TEMPLATE_VERSION_NAME}" @@ -29,6 +39,10 @@ if [ "${CODER_TEMPLATE_ACTIVATE}" = "false" ]; then push_command+=" --activate=false" fi +if [ "${CODER_IGNORE_LOCKFILE}" = "true" ]; then + push_command+=" --ignore-lockfile=true" +fi + # Add confirmation flag to the push command push_command+=" --yes"