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
Copy file name to clipboardExpand all lines: action.yml
+12-70Lines changed: 12 additions & 70 deletions
Original file line number
Diff line number
Diff line change
@@ -103,80 +103,22 @@ outputs:
103
103
runs:
104
104
using: 'composite'
105
105
steps:
106
+
- name: 'Install node dependencies'
107
+
shell: 'bash'
108
+
run: |
109
+
cd "${{ github.action_path }}"
110
+
if [[ "${{ inputs.use_pnpm }}" == "true" ]]; then
111
+
pnpm install --silent --no-audit --prefer-offline
112
+
else
113
+
npm install --silent --no-audit --prefer-offline
114
+
fi
115
+
106
116
- name: 'Validate Inputs'
107
117
id: 'validate_inputs'
108
118
shell: 'bash'
109
119
run: |-
110
-
set -exuo pipefail
111
-
112
-
# Emit a clear warning in three places without failing the step
113
-
warn() {
114
-
local msg="$1"
115
-
echo "WARNING: ${msg}" >&2
116
-
echo "::warning title=Input validation::${msg}"
117
-
if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then
118
-
{
119
-
echo "### Input validation warnings"
120
-
echo
121
-
echo "- ${msg}"
122
-
} >> "${GITHUB_STEP_SUMMARY}"
123
-
fi
124
-
}
125
-
126
-
# Validate the count of authentication methods
127
-
auth_methods=0
128
-
if [[ "${INPUT_GEMINI_API_KEY_PRESENT:-false}" == "true" ]]; then ((++auth_methods)); fi
129
-
if [[ "${INPUT_GOOGLE_API_KEY_PRESENT:-false}" == "true" ]]; then ((++auth_methods)); fi
130
-
if [[ "${INPUT_GCP_WORKLOAD_IDENTITY_PROVIDER_PRESENT:-false}" == "true" ]]; then ((++auth_methods)); fi
131
-
132
-
if [[ ${auth_methods} -eq 0 ]]; then
133
-
warn "No authentication method provided. Please provide one of 'gemini_api_key', 'google_api_key', or 'gcp_workload_identity_provider'."
134
-
fi
135
-
136
-
if [[ ${auth_methods} -gt 1 ]]; then
137
-
warn "Multiple authentication methods provided. Please use only one of 'gemini_api_key', 'google_api_key', or 'gcp_workload_identity_provider'."
138
-
fi
139
-
140
-
# Validate Workload Identity Federation inputs
141
-
if [[ "${INPUT_GCP_WORKLOAD_IDENTITY_PROVIDER_PRESENT:-false}" == "true" ]]; then
142
-
if [[ "${INPUT_GCP_PROJECT_ID_PRESENT:-false}" != "true" ]]; then
143
-
warn "When using Workload Identity Federation ('gcp_workload_identity_provider'), you must also provide 'gcp_project_id'."
144
-
fi
145
-
# Service account is required when using token_format (default behavior)
146
-
# Only optional when explicitly set to empty for direct WIF
147
-
if [[ "${INPUT_GCP_TOKEN_FORMAT}" != "" && "${INPUT_GCP_SERVICE_ACCOUNT_PRESENT:-false}" != "true" ]]; then
148
-
warn "When using Workload Identity Federation with token generation ('gcp_token_format'), you must also provide 'gcp_service_account'. To use direct WIF without a service account, explicitly set 'gcp_token_format' to an empty string."
149
-
fi
150
-
if [[ "${INPUT_USE_VERTEX_AI:-false}" == "${INPUT_USE_GEMINI_CODE_ASSIST:-false}" ]]; then
151
-
warn "When using Workload Identity Federation, you must set exactly one of 'use_vertex_ai' or 'use_gemini_code_assist' to 'true'."
152
-
fi
153
-
fi
154
-
155
-
# Validate Vertex AI API Key
156
-
if [[ "${INPUT_GOOGLE_API_KEY_PRESENT:-false}" == "true" ]]; then
157
-
if [[ "${INPUT_USE_VERTEX_AI:-false}" != "true" ]]; then
158
-
warn "When using 'google_api_key', you must set 'use_vertex_ai' to 'true'."
159
-
fi
160
-
if [[ "${INPUT_USE_GEMINI_CODE_ASSIST:-false}" == "true" ]]; then
161
-
warn "When using 'google_api_key', 'use_gemini_code_assist' cannot be 'true'."
162
-
fi
163
-
fi
164
-
165
-
# Validate Gemini API Key
166
-
if [[ "${INPUT_GEMINI_API_KEY_PRESENT:-false}" == "true" ]]; then
167
-
if [[ "${INPUT_USE_VERTEX_AI:-false}" == "true" || "${INPUT_USE_GEMINI_CODE_ASSIST:-false}" == "true" ]]; then
168
-
warn "When using 'gemini_api_key', both 'use_vertex_ai' and 'use_gemini_code_assist' must be 'false'."
0 commit comments