Skip to content

Commit f662d5c

Browse files
committed
fix: prevent script injection in workflow
1 parent c326ed4 commit f662d5c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/generate-module-metadata.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ jobs:
2828
with:
2929
fetch-depth: 0
3030
- name: Set Version ➕
31+
env:
32+
INPUT_VERSION: ${{ github.event.inputs.version }}
3133
run: |
32-
if [ -z ${{ github.event.inputs.version }} ]; then echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV; else echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV; fi
34+
if [ -z "${INPUT_VERSION}" ]; then echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV"; else echo "RELEASE_VERSION=${INPUT_VERSION}" >> "$GITHUB_ENV"; fi
3335
- name: Set up Python ${{ matrix.python-version }}
3436
uses: actions/setup-python@v5
3537
with:
@@ -41,7 +43,10 @@ jobs:
4143
role-session-name: GitHub_to_AWS_via_FederatedOIDC
4244
aws-region: us-west-2
4345
- name: Generate Metadata
46+
env:
47+
REPO_NAME: ${{ github.event.repository.name }}
48+
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
4449
run: |
4550
python -m pip install --upgrade pip
4651
pip install argparse boto3
47-
python scripts/generate-module-metadata.py -v ${RELEASE_VERSION} -n ${{ github.event.repository.name }} -b ${{ secrets.BUCKET_NAME }}
52+
python scripts/generate-module-metadata.py -v "${RELEASE_VERSION}" -n "${REPO_NAME}" -b "${BUCKET_NAME}"

0 commit comments

Comments
 (0)