Skip to content

Commit 521f6a6

Browse files
feat(hermetic-build): allow custom api definitions dir in generation action
This allows a custom version of googleapis/googleapis to be passed as an argument to hermetic_library_generation.sh. The main use case is a copied and transformed set of protos from aiplatform to vertexai
1 parent 5cc8857 commit 521f6a6

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/scripts/hermetic_library_generation.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ case "${key}" in
5050
showcase_mode="$2"
5151
shift
5252
;;
53+
--api_def_dir)
54+
showcase_mode="$2"
55+
shift
56+
;;
5357
*)
5458
echo "Invalid option: [$1]"
5559
exit 1
@@ -92,12 +96,14 @@ git checkout "${current_branch}"
9296
git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}"
9397

9498
# download api definitions from googleapis repository
95-
googleapis_commitish=$(grep googleapis_commitish "${generation_config}" | cut -d ":" -f 2 | xargs)
96-
api_def_dir=$(mktemp -d)
97-
git clone https://github.com/googleapis/googleapis.git "${api_def_dir}"
98-
pushd "${api_def_dir}"
99-
git checkout "${googleapis_commitish}"
100-
popd
99+
if [[ -z "${api_def_dir}" ]];then
100+
googleapis_commitish=$(grep googleapis_commitish "${generation_config}" | cut -d ":" -f 2 | xargs)
101+
api_def_dir=$(mktemp -d)
102+
git clone https://github.com/googleapis/googleapis.git "${api_def_dir}"
103+
pushd "${api_def_dir}"
104+
git checkout "${googleapis_commitish}"
105+
popd
106+
fi
101107

102108
# we also setup showcase
103109
if [[ "${showcase_mode}" == "true" ]]; then

0 commit comments

Comments
 (0)