Skip to content

Commit

Permalink
github actions yaml files vulnerable to script injections corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
FarhanAnjum-opti committed Sep 23, 2024
1 parent 50533a9 commit adf452f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
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 adf452f

Please sign in to comment.