File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1818 type : environment
1919 required : true
2020
21+ envstring :
22+ description : ' env name as a string'
23+ required : true
24+ type : string
25+
2126# A workflow run is made up of one or more jobs that can run sequentially or in parallel
2227jobs :
28+ validate-env :
29+ runs-on : ubuntu-latest
30+ steps :
31+ - name : checkout repo
32+ uses : actions/checkout@v4
33+
34+ - name : validate env input
35+ id : validate
36+ run : |
37+ ENV_INPUT="${{ github.event.inputs.envstring }}"
38+ if jq -e --arg env "$ENV_INPUT" 'index($env)' environments.json > /dev/null; then
39+ echo "Environment is valid: $ENV_INPUT"
40+ else
41+ echo "Error: Provided environment '$ENV_INPUT' is not valid. Allowed values are: $(jq -r '.[]' environments.json | paste -sd ',')"
42+ exit 1
43+ fi
44+
2345 # This workflow contains a single job called "build"
2446 build :
2547 # The type of runner that the job will run on
You can’t perform that action at this time.
0 commit comments