Skip to content

Commit 429fe87

Browse files
committed
fix(validation): improve validation error messages
The error messages in the input validation script (scripts/validate-inputs.sh) have been updated to improve clarity and ensure they are correctly displayed in the GitHub Actions logs. - The format of the ::error annotations was simplified to the basic ::error::message syntax to prevent them from being hidden in the logs. - The content of the error messages was made more descriptive to help users debug configuration issues more easily. - A minor formatting change (adding a newline) was made to action.yml.
1 parent 42afc49 commit 429fe87

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ runs:
9191
INPUT_GCP_SERVICE_ACCOUNT_PRESENT: "${{ inputs.gcp_service_account != '' }}"
9292
INPUT_USE_VERTEX_AI: '${{ inputs.use_vertex_ai }}'
9393
INPUT_USE_GEMINI_CODE_ASSIST: '${{ inputs.use_gemini_code_assist }}'
94+
9495
- name: 'Configure Gemini CLI'
9596
if: |-
9697
${{ inputs.settings != '' }}

scripts/validate-inputs.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,47 @@ if [[ "${google_api_key_present}" == "true" ]]; then ((auth_methods++)); fi
1919
if [[ "${gcp_workload_identity_provider_present}" == "true" ]]; then ((auth_methods++)); fi
2020

2121
if [[ ${auth_methods} -eq 0 ]]; then
22-
echo "::error title=Configuration error::No authentication method provided. Please provide one of 'gemini_api_key', 'google_api_key', or 'gcp_workload_identity_provider'." >&2
22+
echo "::error::No authentication method provided. Please provide one of 'gemini_api_key', 'google_api_key', or 'gcp_workload_identity_provider'."
2323
exit 1
2424
fi
2525

2626
if [[ ${auth_methods} -gt 1 ]]; then
27-
echo "::error title=Configuration error::Multiple authentication methods provided. Please use only one of 'gemini_api_key', 'google_api_key', or 'gcp_workload_identity_provider'." >&2
27+
echo "::error::Multiple authentication methods provided. Please use only one of 'gemini_api_key', 'google_api_key', or 'gcp_workload_identity_provider'."
2828
exit 1
2929
fi
3030

3131
# WIF validation
3232
if [[ "${gcp_workload_identity_provider_present}" == "true" ]]; then
3333
if [[ "${gcp_project_id_present}" != "true" || "${gcp_service_account_present}" != "true" ]]; then
34-
echo "::error title=Configuration error::When using Workload Identity Federation ('gcp_workload_identity_provider'), you must also provide 'gcp_project_id' and 'gcp_service_account'." >&2
34+
echo "::error::When using Workload Identity Federation ('gcp_workload_identity_provider'), you must also provide 'gcp_project_id' and 'gcp_service_account'."
3535
exit 1
3636
fi
3737
if [[ "${use_vertex_ai}" != "true" && "${use_gemini_code_assist}" != "true" ]]; then
38-
echo "::error title=Configuration error::When using Workload Identity Federation, you must set either 'use_vertex_ai' or 'use_gemini_code_assist' to 'true'." >&2
38+
echo "::error::When using Workload Identity Federation, you must set either 'use_vertex_ai' or 'use_gemini_code_assist' to 'true'. Both are set to 'false', please choose one."
3939
exit 1
4040
fi
4141
if [[ "${use_vertex_ai}" == "true" && "${use_gemini_code_assist}" == "true" ]]; then
42-
echo "::error title=Configuration error::'use_vertex_ai' and 'use_gemini_code_assist' cannot both be 'true'." >&2
42+
echo "::error::When using Workload Identity Federation, 'use_vertex_ai' and 'use_gemini_code_assist' cannot both be 'true'. Both are set to 'true', please choose one."
4343
exit 1
4444
fi
4545
fi
4646

4747
# Vertex AI API Key validation
4848
if [[ "${google_api_key_present}" == "true" ]]; then
4949
if [[ "${use_vertex_ai}" != "true" ]]; then
50-
echo "::error title=Configuration error::When using 'google_api_key', you must set 'use_vertex_ai' to 'true'." >&2
50+
echo "::error::When using 'google_api_key', you must set 'use_vertex_ai' to 'true'."
5151
exit 1
5252
fi
5353
if [[ "${use_gemini_code_assist}" == "true" ]]; then
54-
echo "::error title=Configuration error::'use_gemini_code_assist' cannot be 'true' when using 'google_api_key'." >&2
54+
echo "::error::When using 'google_api_key', 'use_gemini_code_assist' cannot be 'true'."
5555
exit 1
5656
fi
5757
fi
5858

5959
# Gemini API Key validation
6060
if [[ "${gemini_api_key_present}" == "true" ]]; then
6161
if [[ "${use_vertex_ai}" == "true" || "${use_gemini_code_assist}" == "true" ]]; then
62-
echo "::error title=Configuration error::When using 'gemini_api_key', both 'use_vertex_ai' and 'use_gemini_code_assist' must be 'false'." >&2
62+
echo "::error::When using 'gemini_api_key', both 'use_vertex_ai' and 'use_gemini_code_assist' must be 'false'."
6363
exit 1
6464
fi
6565
fi

0 commit comments

Comments
 (0)