If you use GitHub Actions to run Workflows and tests, you might have spotted this warning recently:
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/
This warning means that GitHub will deprecate a certain syntax which populates variables, and disables it by end of May 2023.
How does this syntax look like? Let me show one example:
|
|
This is from the Ansible lxc-ssh connection plugin, which allows to use regular ssh connections to manage LXC container in Ubuntu.
The tests for this plugin spin up an Ubuntu instance, and then a container inside and test the connectivity and functionality for the plugin. Among other challenges, the test workflow needs to decide which commands to run, based on the LXC version. Above code stores the version in the variable $LXD_Version
. This is the old, and deprecated syntax, using ::set-output
.
GitHub explains how to change the code, and use the new syntax. Unfortunately the description is a bit ambigous, as it mixes “name
” and “name
” (yes, that’s both “name
” for you).
|
|
Let me change this example, to make it more obvious what needs to be updated:
|
|
The name=varname
is removed, in the new syntax it’s varname=varvalue
. The above example, in the new syntax, is:
|
|
Everytime I update one of the workflows I first completely miss the part that the old syntax has a superfluous name=
in it. After a couple seconds I remember again, and remove this part.