Skip to content

Commit adf452f

Browse files
github actions yaml files vulnerable to script injections corrected
1 parent 50533a9 commit adf452f

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.github/workflows/csharp_release.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ jobs:
1515
- name: Set semantic version variable
1616
id: set_version
1717
run: |
18-
TAG=${{ env.TAG }}
19-
SEMANTIC_VERSION=$(echo "${TAG}" | grep -Po "(?<=^|[^0-9])([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(-[a-zA-Z]+[0-9]*)?)")
18+
SEMANTIC_VERSION=$(echo "$TAG" | grep -Po "(?<=^|[^0-9])([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(-[a-zA-Z]+[0-9]*)?)")
2019
if [ -z "${SEMANTIC_VERSION}" ]; then
2120
echo "Tag did not start with a semantic version number (e.g., #.#.#; #.#.#.#; #.#.#.#-beta)"
2221
exit 1
@@ -25,10 +24,10 @@ jobs:
2524
- name: Output tag & semantic version
2625
id: outputs
2726
run: |
28-
echo ${{ env.TAG }}
27+
echo "$TAG"
2928
echo ${{ steps.set_version.outputs.semantic_version }}
3029
outputs:
31-
tag: ${{ env.TAG }}
30+
tag: $TAG
3231
semanticVersion: ${{ steps.set_version.outputs.semantic_version }}
3332

3433
buildFrameworkVersions:

.github/workflows/integration_test.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@ jobs:
2323
path: 'home/runner/travisci-tools'
2424
ref: 'master'
2525
- name: set SDK Branch if PR
26+
env:
27+
HEAD_REF: ${{ github.head_ref }}
2628
if: ${{ github.event_name == 'pull_request' }}
2729
run: |
28-
echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
29-
echo "TRAVIS_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
30+
echo "SDK_BRANCH=$HEAD_REF" >> $GITHUB_ENV
31+
echo "TRAVIS_BRANCH=$HEAD_REF" >> $GITHUB_ENV
3032
- name: set SDK Branch if not pull request
33+
env:
34+
REF_NAME: ${{ github.ref_name }}
3135
if: ${{ github.event_name != 'pull_request' }}
3236
run: |
33-
echo "SDK_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
34-
echo "TRAVIS_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
37+
echo "SDK_BRANCH=$REF_NAME" >> $GITHUB_ENV
38+
echo "TRAVIS_BRANCH=$REF_NAME" >> $GITHUB_ENV
3539
- name: Trigger build
3640
env:
3741
SDK: csharp

0 commit comments

Comments
 (0)