Skip to content

Commit

Permalink
[FSSDK-10665] fix: Github Actions YAML files vulnerable to script inj…
Browse files Browse the repository at this point in the history
…ections corrected (#372)

* github actions yaml files vulnerable to script injections corrected

* build: update NUnit.Console to 3.18.2

CI error similar to nunit/nunit3-vs-adapter#1049

* chore: downgrade to NUnit.Console 3.18.1

v3.18.2 introduced an incompatibility

---------

Co-authored-by: Mike Chu <[email protected]>
  • Loading branch information
FarhanAnjum-opti and mikechu-optimizely authored Sep 24, 2024
1 parent 50533a9 commit c37a74d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ jobs:
run: msbuild /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(pwd)/keypair.snk /p:Configuration=Release ./OptimizelySDK.NETFramework.sln
- name: Install & Run NUnit tests
run: |
nuget install NUnit.Console -Version 3.15.2 -DirectDownload -OutputDirectory .
nuget install NUnit.Console -Version 3.18.1 -DirectDownload -OutputDirectory .
# https://docs.nunit.org/articles/nunit/running-tests/Console-Command-Line.html
./NUnit.ConsoleRunner.3.15.2\tools\nunit3-console.exe /timeout 10000 /process Separate ./OptimizelySDK.Tests/bin/Release/OptimizelySDK.Tests.dll
./NUnit.ConsoleRunner.3.18.1\tools\nunit3-console.exe /timeout 10000 /process Separate ./OptimizelySDK.Tests/bin/Release/OptimizelySDK.Tests.dll
netStandard16:
name: Build Standard 1.6
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/csharp_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
- name: Set semantic version variable
id: set_version
run: |
TAG=${{ env.TAG }}
SEMANTIC_VERSION=$(echo "${TAG}" | grep -Po "(?<=^|[^0-9])([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(-[a-zA-Z]+[0-9]*)?)")
SEMANTIC_VERSION=$(echo "$TAG" | grep -Po "(?<=^|[^0-9])([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(-[a-zA-Z]+[0-9]*)?)")
if [ -z "${SEMANTIC_VERSION}" ]; then
echo "Tag did not start with a semantic version number (e.g., #.#.#; #.#.#.#; #.#.#.#-beta)"
exit 1
Expand All @@ -25,10 +24,10 @@ jobs:
- name: Output tag & semantic version
id: outputs
run: |
echo ${{ env.TAG }}
echo "$TAG"
echo ${{ steps.set_version.outputs.semantic_version }}
outputs:
tag: ${{ env.TAG }}
tag: $TAG
semanticVersion: ${{ steps.set_version.outputs.semantic_version }}

buildFrameworkVersions:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ jobs:
path: 'home/runner/travisci-tools'
ref: 'master'
- name: set SDK Branch if PR
env:
HEAD_REF: ${{ github.head_ref }}
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "TRAVIS_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "SDK_BRANCH=$HEAD_REF" >> $GITHUB_ENV
echo "TRAVIS_BRANCH=$HEAD_REF" >> $GITHUB_ENV
- name: set SDK Branch if not pull request
env:
REF_NAME: ${{ github.ref_name }}
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "SDK_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
echo "TRAVIS_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
echo "SDK_BRANCH=$REF_NAME" >> $GITHUB_ENV
echo "TRAVIS_BRANCH=$REF_NAME" >> $GITHUB_ENV
- name: Trigger build
env:
SDK: csharp
Expand Down

0 comments on commit c37a74d

Please sign in to comment.