-
Notifications
You must be signed in to change notification settings - Fork 5
Two new optional inputs, provisioner_tag
and ignore_lockfile
, to enhance the configurability of the template push process
#14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the Coder template push action by adding two new optional configuration inputs: provisioner_tag
for template version identification in the UI and ignore_lockfile
for handling missing Terraform lock files.
- Added
provisioner_tag
input with default value "-" to tag template versions - Added
ignore_lockfile
input with default value "false" to suppress lockfile warnings - Updated shell script to conditionally include the new flags in the push command
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
action.yaml | Added two new input definitions and corresponding environment variables |
push_template.sh | Implemented conditional logic to include new command-line flags based on environment variables |
provisioner_tag: | ||
description: "Add provisioner tag to the template, useful for identifying the template version in the Coder UI" | ||
required: false | ||
default: "-" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value "-" for provisioner_tag is unclear and may cause confusion. Consider using an empty string or a more descriptive default value, or make it truly optional without a default.
default: "-" | |
default: "" |
Copilot uses AI. Check for mistakes.
@@ -19,6 +19,11 @@ 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provisioner tag value is always passed when the environment variable is set, even if it's the default "-" value. Consider checking if the value is meaningful (not "-") before adding it to the command.
if [ -n "${CODER_PROVISIONER_TAG}" ]; then | |
if [ -n "${CODER_PROVISIONER_TAG}" ] && [ "${CODER_PROVISIONER_TAG}" != "-" ]; then |
Copilot uses AI. Check for mistakes.
This pull request introduces two new optional inputs,
provisioner_tag
andignore_lockfile
, to enhance the configurability of the template push process. These inputs are integrated into the action's environment variables and thepush_template.sh
script to support additional functionality.Enhancements to
action.yaml
inputs:provisioner_tag
input to allow specifying a provisioner tag for identifying the template version in the Coder UI. Default value is"-"
.ignore_lockfile
input to enable ignoring warnings about the absence of a.terraform.lock.hcl
file. Default value is"false"
.Updates to the
push_template.sh
script:provisioner_tag
input into the push command to include a--provisioner-tag
option if specified.ignore_lockfile
input into the push command to add a--ignore-lockfile=true
flag when enabled.