about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-10-02 13:22:26 +0000
committerbors <bors@rust-lang.org>2020-10-02 13:22:26 +0000
commita585aaefb662ae26f8675955f26fad9be4fea96b (patch)
tree1367bbfe331d41eb3421b7aace6b966dc22eb827
parent4dedf5edd51d0e0b1b45a61403842f8406e13b2c (diff)
parentb710f9c5d54ae9269f9ca6e002ad9300ecb3ab9e (diff)
downloadrust-a585aaefb662ae26f8675955f26fad9be4fea96b.tar.gz
rust-a585aaefb662ae26f8675955f26fad9be4fea96b.zip
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](https://github.com/actions/toolkit/security/advisories/GHSA-mfwh-5m23-j46w).

Our self-hosted runners are on version 2.273.4, so they already have support for this.

r? `@Mark-Simulacrum`
-rw-r--r--src/ci/shared.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ci/shared.sh b/src/ci/shared.sh
index 8222758ed6d..c93d4774e39 100644
--- a/src/ci/shared.sh
+++ b/src/ci/shared.sh
@@ -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
@@ -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