File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,13 +60,17 @@ jobs:
6060 with :
6161 fetch-depth : 0
6262
63+ - name : Set up boilerplate config.json
64+ if : github.repository == inputs.template-repository-name
65+ run : |
66+ functionName=$(echo "${{ github.event.repository.name }}" | gsed -E 's/([A-Z])([A-Z]*)/\L\1\2/g' | gsed -E 's/-([a-z])/\U\1/g' | tr -d '-')
67+ echo "{\"EvaluationFunctionName\": \"$functionName\"}" > config.json
68+
6369 - name : Check for config.json
64- if : github.repository != inputs.template-repository-name
6570 run : |
6671 if [[ ! -f "config.json" ]]; then echo "Error: config.json not found."; exit 1; fi
6772
6873 - name : Parse config.json
69- if : github.repository != inputs.template-repository-name
7074 id : config
7175 run : |
7276 echo 'config<<EOF' >> $GITHUB_OUTPUT
7579
7680 - name : Get Evaluation Function Name
7781 id : evaluation_function_name
78- env :
79- TEMPLATE_REPOSITORY : ${{ github.repository == inputs.template-repository-name }}
8082 run : |
81- if [[ $TEMPLATE_REPOSITORY == true ]]; then
82- # Convert repository name to function name
83- functionName=$(echo "${{ github.event.repository.name }}" | gsed -E 's/([A-Z])([A-Z]*)/\L\1\2/g' | gsed -E 's/-([a-z])/\U\1/g' | tr -d '-')
84- else
85- functionName="${{fromJson(steps.config.outputs.config).EvaluationFunctionName}}"
86- if [[ -z "$functionName" ]]; then echo "Set EvaluationFunctionName in config.json"; exit 1; fi
87- fi
83+ functionName="${{fromJson(steps.config.outputs.config).EvaluationFunctionName}}"
84+ if [[ -z "$functionName" ]]; then echo "Set EvaluationFunctionName in config.json"; exit 1; fi
8885 echo "name=$functionName" >> "$GITHUB_OUTPUT"
8986
9087 build :
You can’t perform that action at this time.
0 commit comments