Two new optional inputs, provisioner_tag and ignore_lockfile, to enhance the configurability of the template push process (#14)

This commit is contained in:
Bruno Carvalho de Araujo 2025-10-29 02:42:04 -03:00 committed by GitHub
parent c5dfa097d7
commit 5b192bbf2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 0 deletions

View file

@ -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 }}

View file

@ -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"