Skip to content

Commit

Permalink
Auto merge of #77418 - pietroalbini:ci-environment-files, r=Mark-Simu…
Browse files Browse the repository at this point in the history
…lacrum

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`
  • Loading branch information
bors committed Oct 2, 2020
2 parents 4dedf5e + b710f9c commit a585aae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ci/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function ciCommandAddPath {
if isAzurePipelines; then
echo "##vso[task.prependpath]${path}"
elif isGitHubActions; then
echo "::add-path::${path}"
echo "${path}" >> "${GITHUB_PATH}"
else
echo "ciCommandAddPath only works inside CI!"
exit 1
Expand All @@ -122,7 +122,7 @@ function ciCommandSetEnv {
if isAzurePipelines; then
echo "##vso[task.setvariable variable=${name}]${value}"
elif isGitHubActions; then
echo "::set-env name=${name}::${value}"
echo "${name}=${value}" >> "${GITHUB_ENV}"
else
echo "ciCommandSetEnv only works inside CI!"
exit 1
Expand Down

0 comments on commit a585aae

Please sign in to comment.