Skip to content

Commit 998989d

Browse files
committed
Fix security issue
Signed-off-by: ZePan110 <ze.pan@intel.com>
1 parent ccc145e commit 998989d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/_helm-e2e.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,19 @@ jobs:
131131
ref: ${{ steps.get-checkout-ref.outputs.CHECKOUT_REF }}
132132
fetch-depth: 0
133133

134+
- name: Validate Inputs
135+
run: |
136+
set -x
137+
cd ${{ github.workspace }}
138+
folders=($(find . -maxdepth 1 -type d ! -name ".*" -printf "%f\n" | tr '[:upper:]' '[:lower:]'))
139+
echo "folders: ${folders[@]}"
140+
echo "example: ${{ inputs.example }}"
141+
example_lower=$(echo "CodeGen" | tr '[:upper:]' '[:lower:]')
142+
if [[ ! " ${folders[@]} " =~ " ${example_lower} " ]]; then
143+
echo "Error: Input '${example_lower}' is not in the list of folders."
144+
exit 1
145+
fi
146+
134147
- name: Set variables
135148
env:
136149
example: ${{ inputs.example }}

0 commit comments

Comments
 (0)