Skip to content

Commit 04d4dbd

Browse files
authored
replace set-env commands with github env file (#181)
Fixes a security flaw outlined in, GHSA-mfwh-5m23-j46w
1 parent 6c9d947 commit 04d4dbd

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

.github/workflows/android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131

3232
- name: Set env variables for subsequent steps (all)
3333
run: |
34-
echo "::set-env name=MATRIX_UNIQUE_NAME::${{ matrix.os }}-${{ matrix.architecture }}"
35-
echo "::set-env name=GHA_INSTALL_CCACHE::1"
34+
echo "MATRIX_UNIQUE_NAME=${{ matrix.os }}-${{ matrix.architecture }}" >> $GITHUB_ENV
35+
echo "GHA_INSTALL_CCACHE=1" >> $GITHUB_ENV
3636
3737
- name: Setup python
3838
uses: actions/setup-python@v2

.github/workflows/cpp-packaging.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ jobs:
229229

230230
- name: Set env variables for subsequent steps (all)
231231
run: |
232-
echo "::set-env name=VCPKG_RESPONSE_FILE::external/vcpkg_${{ matrix.vcpkg_triplet }}_response_file.txt"
233-
echo "::set-env name=MATRIX_UNIQUE_NAME::${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.python_version }}"
234-
echo "::set-env name=SDK_NAME::${{ matrix.sdk_platform }}-${{ matrix.architecture }}-${{ matrix.build_type }}-${{ matrix.linkage }}"
232+
echo "VCPKG_RESPONSE_FILE=external/vcpkg_${{ matrix.vcpkg_triplet }}_response_file.txt" >> $GITHUB_ENV
233+
echo "MATRIX_UNIQUE_NAME=${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.python_version }}" >> $GITHUB_ENV
234+
echo "SDK_NAME=${{ matrix.sdk_platform }}-${{ matrix.architecture }}-${{ matrix.build_type }}-${{ matrix.linkage }}" >> $GITHUB_ENV
235235
236236
- name: Add msbuild to PATH (windows)
237237
if: startsWith(matrix.os, 'windows')

.github/workflows/desktop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jobs:
4545

4646
- name: Set env variables for subsequent steps (all)
4747
run: |
48-
echo "::set-env name=VCPKG_RESPONSE_FILE::external/vcpkg_custom_data/response_files/${{ matrix.architecture }}-${{ matrix.vcpkg_triplet_suffix }}.txt"
49-
echo "::set-env name=MATRIX_UNIQUE_NAME::${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.msvc_runtime }}"
48+
echo "VCPKG_RESPONSE_FILE=external/vcpkg_custom_data/response_files/${{ matrix.architecture }}-${{ matrix.vcpkg_triplet_suffix }}.txt" >> $GITHUB_ENV
49+
echo "MATRIX_UNIQUE_NAME=${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.msvc_runtime }}" >> $GITHUB_ENV
5050
5151
- name: Cache vcpkg C++ dependencies
5252
id: cache_vcpkg

.github/workflows/integration_tests.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@ jobs:
6666

6767
- name: Set env vars (ubuntu)
6868
if: startsWith(matrix.os, 'ubuntu')
69-
run: echo "::set-env name=VCPKG_TRIPLET::x64-linux"
69+
run: echo "VCPKG_TRIPLET=x64-linux" >> $GITHUB_ENV
7070
- name: Set env vars (macos)
7171
if: startsWith(matrix.os, 'macos')
72-
run: echo "::set-env name=VCPKG_TRIPLET::x64-osx"
72+
run: echo "VCPKG_TRIPLET=x64-osx" >> $GITHUB_ENV
7373
- name: Set env vars (windows)
7474
if: startsWith(matrix.os, 'windows')
75-
run: echo "::set-env name=VCPKG_TRIPLET::x64-windows-static"
75+
run: echo "VCPKG_TRIPLET=x64-windows-static" >> $GITHUB_ENV
7676
- name: Set env vars(all)
77-
run: echo "::set-env name=VCPKG_RESPONSE_FILE::external/vcpkg_${{ env.VCPKG_TRIPLET }}_response_file.txt"
77+
run: echo "VCPKG_RESPONSE_FILE=external/vcpkg_${{ env.VCPKG_TRIPLET }}_response_file.txt" >> $GITHUB_ENV
7878

7979
- name: Add msbuild to PATH (windows)
8080
if: startsWith(matrix.os, 'windows')
8181
uses: microsoft/[email protected]
82-
82+
8383
- name: Cache vcpkg C++ dependencies
8484
if: matrix.target_platform == 'Desktop'
8585
id: cache_vcpkg
@@ -97,7 +97,7 @@ jobs:
9797
if: matrix.target_platform == 'Desktop'
9898
run: |
9999
python scripts/gha/install_prereqs_desktop.py
100-
100+
101101
- name: Install SDK Android prerequisites
102102
if: matrix.target_platform == 'Android'
103103
shell: bash
@@ -108,27 +108,27 @@ jobs:
108108
if: matrix.target_platform == 'iOS'
109109
run: |
110110
build_scripts/ios/install_prereqs.sh
111-
111+
112112
- name: Prepare for integration tests
113113
run: |
114114
pip install -r scripts/gha/requirements.txt
115115
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
116-
116+
117117
- name: Build integration tests (and run Desktop tests)
118118
# The set up script for Android will download the NDK here.
119119
env:
120120
NDK_ROOT: '/tmp/android-ndk-r16b'
121121
run: |
122122
python scripts/gha/build_testapps.py --t ${{ github.event.inputs.apis }} --p ${{ matrix.target_platform }} --output_directory ${{ github.workspace }} --use_vcpkg --execute_desktop_testapp --noadd_timestamp
123-
123+
124124
# Workaround for https://github.com/GoogleCloudPlatform/github-actions/issues/100
125125
# Must be run after the Python setup action
126126
- name: Set CLOUDSDK_PYTHON (Windows)
127127
if: startsWith(matrix.os, 'windows') && !cancelled()
128-
run: echo "::set-env name=CLOUDSDK_PYTHON::${{env.pythonLocation}}\python.exe"
128+
run: echo "CLOUDSDK_PYTHON=${{env.pythonLocation}}\python.exe" >> $GITHUB_ENV
129129
- name: Install Cloud SDK
130130
if: ${{ !cancelled() }}
131-
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
131+
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
132132
- name: Upload Desktop Artifacts to GCS
133133
if: matrix.target_platform == 'Desktop' && !cancelled()
134134
run: |

.github/workflows/ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: iOS Builds
22

3-
on:
3+
on:
44
pull_request:
55
types: [opened, reopened, synchronize]
66

build_scripts/android/install_prereqs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ if [[ $(uname) == "Darwin" ]]; then
44
platform=darwin
55
if [[ ! -z "${GHA_INSTALL_CCACHE}" ]]; then
66
brew install ccache
7-
echo "::set-env name=CCACHE_INSTALLED::1"
7+
echo "CCACHE_INSTALLED=1" >> $GITHUB_ENV
88
fi
99
elif [[ $(uname) == "Linux" ]]; then
1010
platform=linux
1111
if [[ ! -z "${GHA_INSTALL_CCACHE}" ]]; then
1212
sudo apt install ccache
13-
echo "::set-env name=CCACHE_INSTALLED::1"
13+
echo "CCACHE_INSTALLED=1" >> $GITHUB_ENV
1414
fi
1515
else
1616
platform=windows

0 commit comments

Comments
 (0)