Skip to content

Commit 2bcfcd9

Browse files
FSSDK-10665] fix: Github Actions YAML files vulnerable to script injections corrected (#555)
1 parent 38520c8 commit 2bcfcd9

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/integration_tests.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ jobs:
2020
path: 'home/runner/travisci-tools'
2121
ref: 'master'
2222
- name: set SDK Branch if PR
23+
env:
24+
HEAD_REF: ${{ github.head_ref }}
2325
if: ${{ github.event_name == 'pull_request' }}
2426
run: |
25-
echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
27+
echo "SDK_BRANCH=$HEAD_REF" >> $GITHUB_ENV
2628
- name: set SDK Branch if not pull request
29+
env:
30+
REF_NAME: ${{ github.ref_name }}
2731
if: ${{ github.event_name != 'pull_request' }}
2832
run: |
29-
echo "SDK_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
30-
echo "TRAVIS_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
33+
echo "SDK_BRANCH=$REF_NAME" >> $GITHUB_ENV
34+
echo "TRAVIS_BRANCH=$REF_NAME" >> $GITHUB_ENV
3135
- name: Trigger build
3236
env:
3337
SDK: swift

.github/workflows/unit_tests.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,17 @@ jobs:
5454
# macos version and supported simulator_xcode_versions are all related to this xcode_version, so be careful when you upgrade this.
5555
xcode-version: 14.1
5656
- name: set SDK Branch if PR
57+
env:
58+
BASE_REF: ${{ github.base_ref }}
5759
if: ${{ github.event_name == 'pull_request' }}
5860
run: |
59-
echo "BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
61+
echo "BRANCH=$BASE_REF" >> $GITHUB_ENV
6062
- name: set SDK Branch if not pull request
63+
env:
64+
REF_NAME: ${{ github.ref_name }}
6165
if: ${{ github.event_name != 'pull_request' }}
6266
run: |
63-
echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
67+
echo "BRANCH=$REF_NAME" >> $GITHUB_ENV
6468
- id: unit_tests
6569
env:
6670
SCHEME: ${{ matrix.scheme }}

0 commit comments

Comments
 (0)