Skip to content

Commit c92584e

Browse files
authored
Merge pull request #2214 from Giskard-AI/feature/eng-1081-use-good-practices-for-ci-workflow-var-interpolation
fix(security): prevent command injection in GitHub Actions workflows [ENG-1131]
2 parents 752a81f + aba8dd0 commit c92584e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

‎.github/workflows/create-release.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ jobs:
2828
exit 1
2929
3030
- name: Write release version env vars (with/without v)
31+
env:
32+
INPUT_VERSION: ${{ inputs.version }}
3133
run: |
32-
VERSION_NAME="v${{ inputs.version }}"
34+
VERSION_NAME="v$INPUT_VERSION"
3335
VERSION_NUMBER="${VERSION_NAME:1}"
3436
echo "VERSION_NUMBER=${VERSION_NUMBER}" >> $GITHUB_ENV
3537
echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_ENV

‎.github/workflows/retry-workflow.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
env:
1515
GH_REPO: ${{ github.repository }}
1616
GH_TOKEN: ${{ github.token }}
17+
RUN_ID: ${{ inputs.run_id }}
1718
run: |
18-
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
19-
gh run rerun ${{ inputs.run_id }} --failed
19+
gh run watch "$RUN_ID" > /dev/null 2>&1
20+
gh run rerun "$RUN_ID" --failed

0 commit comments

Comments
 (0)