Skip to content

Commit 9fd05e1

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

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/_helm-e2e.yml

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

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

0 commit comments

Comments
 (0)