You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(validate-inputs): surface errors in logs, annotation, and step summary (#299)
Introduce error() helper to:
- write to stderr for log visibility
- emit a titled ::error:: annotation for Checks
- append to GITHUB_STEP_SUMMARY for run summary
Replace ad-hoc echo+exit paths with error() across all validation
branches.
@@ -19,47 +37,39 @@ if [[ "${google_api_key_present}" == "true" ]]; then ((auth_methods++)); fi
19
37
if [[ "${gcp_workload_identity_provider_present}"=="true" ]];then((auth_methods++));fi
20
38
21
39
if [[ ${auth_methods}-eq 0 ]];then
22
-
echo"::error::No authentication method provided. Please provide one of 'gemini_api_key', 'google_api_key', or 'gcp_workload_identity_provider'."
23
-
exit 1
40
+
error "No authentication method provided. Please provide one of 'gemini_api_key', 'google_api_key', or 'gcp_workload_identity_provider'."
24
41
fi
25
42
26
43
if [[ ${auth_methods}-gt 1 ]];then
27
-
echo"::error::Multiple authentication methods provided. Please use only one of 'gemini_api_key', 'google_api_key', or 'gcp_workload_identity_provider'."
28
-
exit 1
44
+
error "Multiple authentication methods provided. Please use only one of 'gemini_api_key', 'google_api_key', or 'gcp_workload_identity_provider'."
29
45
fi
30
46
31
47
# WIF validation
32
48
if [[ "${gcp_workload_identity_provider_present}"=="true" ]];then
33
49
if [[ "${gcp_project_id_present}"!="true"||"${gcp_service_account_present}"!="true" ]];then
34
-
echo"::error::When using Workload Identity Federation ('gcp_workload_identity_provider'), you must also provide 'gcp_project_id' and 'gcp_service_account'."
35
-
exit 1
50
+
error "When using Workload Identity Federation ('gcp_workload_identity_provider'), you must also provide 'gcp_project_id' and 'gcp_service_account'."
36
51
fi
37
52
if [[ "${use_vertex_ai}"!="true"&&"${use_gemini_code_assist}"!="true" ]];then
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."
39
-
exit 1
53
+
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."
40
54
fi
41
55
if [[ "${use_vertex_ai}"=="true"&&"${use_gemini_code_assist}"=="true" ]];then
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."
43
-
exit 1
56
+
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."
44
57
fi
45
58
fi
46
59
47
60
# Vertex AI API Key validation
48
61
if [[ "${google_api_key_present}"=="true" ]];then
49
62
if [[ "${use_vertex_ai}"!="true" ]];then
50
-
echo"::error::When using 'google_api_key', you must set 'use_vertex_ai' to 'true'."
51
-
exit 1
63
+
error "When using 'google_api_key', you must set 'use_vertex_ai' to 'true'."
52
64
fi
53
65
if [[ "${use_gemini_code_assist}"=="true" ]];then
54
-
echo"::error::When using 'google_api_key', 'use_gemini_code_assist' cannot be 'true'."
55
-
exit 1
66
+
error "When using 'google_api_key', 'use_gemini_code_assist' cannot be 'true'."
56
67
fi
57
68
fi
58
69
59
70
# Gemini API Key validation
60
71
if [[ "${gemini_api_key_present}"=="true" ]];then
61
72
if [[ "${use_vertex_ai}"=="true"||"${use_gemini_code_assist}"=="true" ]];then
62
-
echo"::error::When using 'gemini_api_key', both 'use_vertex_ai' and 'use_gemini_code_assist' must be 'false'."
63
-
exit 1
73
+
error "When using 'gemini_api_key', both 'use_vertex_ai' and 'use_gemini_code_assist' must be 'false'."
0 commit comments