If you don't specify the TF_CLI_CONFIG_FILE environment variable, the
default config is written to $HOME directory, which could theoretically
be shared by multiple runners when using self-hosted runners.
When TF_CLI_CONFIG_FILE is _not_ in use, I replaced the usage of
$HOME with the directory $RUNNER_TEMP, whose setup/cleanup is
managed by the runner framework and exported a TF_CLI_CONFIG_FILE.
On Windows runners, extracting the downloaded CLI zip file was failing because the file didn't have a .zip extension. This commit attempts to solve the problem by adding the extension to the downloaded file before extraction.
That allows to install for example the latest bug-fix version of
terraform 1.12.* even if 1.13 is already installed.
Co-authored-by: Matthew Sanabria <24284972+sudomateo@users.noreply.github.com>