Skip to content

Commit 13c4749

Browse files
authored
Fix security issue (#1884)
Signed-off-by: ZePan110 <ze.pan@intel.com>
1 parent 99b62ae commit 13c4749

2 files changed

Lines changed: 15 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 "${{ inputs.example }}" | 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 }}

.github/workflows/pr-chart-e2e.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ concurrency:
1919
jobs:
2020
job1:
2121
name: Get-Test-Matrix
22+
permissions:
23+
contents: read
24+
pull-requests: read
2225
runs-on: ubuntu-latest
2326
outputs:
2427
run_matrix: ${{ steps.get-test-matrix.outputs.run_matrix }}

0 commit comments

Comments
 (0)