Is there a policy on using GITHUB_ENV or set-output?

Though both can have a common value across steps,
what is the best practice to use “echo” {name} = {value} “>> $ GITHUB_ENV” and “set-output” properly?

Is there a policy on which one should use?
In any case is it okay to use either?

Environment variables (set with GITHUB_ENV) are usually easier to use in run steps, but will be gone at the end of a job. Step outputs can be turned into job outputs and used across jobs that way. Other than that limitation you can use whichever you prefer. :slightly_smiling_face:

1 Like