File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }}
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ concurrency:
1919jobs :
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 }}
You can’t perform that action at this time.
0 commit comments