I've got a build that is running terraform on github actions (I actually have loads of them) and I've been noticing that they are very chatty about warnings now.
)
The warning is
1 | The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ |
The history here without reading that link is basically that github are changing how we push variables to the pipeline for use in later steps. There were some security implications with the old approach and the new approach should be better
1 | - name: Save variable |
Problem was that the steps on which I was having trouble didn't obviously use the set-output
command.
1 | ... |
I had to dig a bit to find out that it was actually the terraform
command that was causing the problem. See as part of the build I install the terraform cli using the
1 | - name: HashiCorp - Setup Terraform |
Turns out that as of writing the latest version of the wrapper installed by the setup-terraform task makes use of an older version of the @actions/core
package. This package is what is used to set the output and before version 1.10 it did so using set-output
. A fix has been merged into the setup-terraform project but no update released yet.
For now I found that I had no need for the wrapper so I disabled it with
1 | - name: HashiCorp - Setup Terraform |
but for future readers if there is a more recent version of setup-terraform than 2.0.2 then you can update to that to remove the warnings. Now my build is clean
)