Skip to content

Commit a585aae

Browse files
committed
Auto merge of #77418 - pietroalbini:ci-environment-files, r=Mark-Simulacrum
Switch to environment files to change the environment on GHA This PR switches our CI to use GitHub's new [environment files](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files) to set environment variables and add items to `$PATH`, as GitHub [plans to disable the old `::set-env` and `::add-path` log commands](https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/) due to a [security issue](GHSA-mfwh-5m23-j46w). Our self-hosted runners are on version 2.273.4, so they already have support for this. r? `@Mark-Simulacrum`
2 parents 4dedf5e + b710f9c commit a585aae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ci/shared.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function ciCommandAddPath {
104104
if isAzurePipelines; then
105105
echo "##vso[task.prependpath]${path}"
106106
elif isGitHubActions; then
107-
echo "::add-path::${path}"
107+
echo "${path}" >> "${GITHUB_PATH}"
108108
else
109109
echo "ciCommandAddPath only works inside CI!"
110110
exit 1
@@ -122,7 +122,7 @@ function ciCommandSetEnv {
122122
if isAzurePipelines; then
123123
echo "##vso[task.setvariable variable=${name}]${value}"
124124
elif isGitHubActions; then
125-
echo "::set-env name=${name}::${value}"
125+
echo "${name}=${value}" >> "${GITHUB_ENV}"
126126
else
127127
echo "ciCommandSetEnv only works inside CI!"
128128
exit 1

0 commit comments

Comments
 (0)