From ac244270c9de50a7a68e2ac7e2a2a28e8cdd1c16 Mon Sep 17 00:00:00 2001 From: Steven Normore Date: Thu, 22 Feb 2024 15:49:44 -0500 Subject: [PATCH 1/2] Provide env annotation for timeout option --- pkg/options/options.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/options/options.go b/pkg/options/options.go index 57cb072..16b970b 100644 --- a/pkg/options/options.go +++ b/pkg/options/options.go @@ -11,5 +11,5 @@ type Options struct { RunTitle string `long:"run-title" env:"TERRAFORM_RUN_TITLE" description:"Title for the Terraform Run. Defaults to latest commit message if unset."` DryRun bool `long:"dry-run" description:"Do not actually run the Terraform Run. Useful for testing."` VariableValueRequiredPrefix string `long:"variable-value-required-prefix" env:"VARIABLE_VALUE_REQUIRED_PREFIX" description:"If set, the VariableValue must start with this prefix"` - Timeout time.Duration `long:"timeout" description:"Run timeout" default:"0"` + Timeout time.Duration `long:"timeout" env:"TIMEOUT" description:"Run timeout" default:"0"` } From 4db520660d6453e4d53d4cfc7d3c5ac48993d247 Mon Sep 17 00:00:00 2001 From: Steven Normore Date: Thu, 22 Feb 2024 15:53:40 -0500 Subject: [PATCH 2/2] Add timeout support to action.yml --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index 9b95671..1c60044 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,8 @@ inputs: description: "Require the value specified in `variable-value` to have the supplied prefix" run-title-override: description: "The title of the terraform run. If not specified, defaults to latest commit message" + timeout: + description: "The timeout for the terraform run. If not specified, defaults to 15 minutes" runs: using: "docker" image: "Dockerfile" @@ -34,3 +36,4 @@ runs: TERRAFORM_VARIABLE_VALUE: ${{ inputs.variable-value }} VARIABLE_VALUE_REQUIRED_PREFIX: ${{ inputs.variable-value-required-prefix }} TERRAFORM_RUN_TITLE: ${{ inputs.run-title-override }} + TIMEOUT: ${{ inputs.timeout }}