chore: Handle case with multiple artifacts (#5442)
This commit is contained in:
1 parent
a43cb90a32
commit
54c9dc850d
1 file changed
+3
-2
+3
-2
@@ -37,10 +37,11 @@ if which gh &> /dev/null; then
|
||||
echo "Found gh cli, attempting to download ui assets"
|
||||
|
||||
artifact_id=$(gh api "repos/hashicorp/${REPO_NAME}/actions/artifacts" --paginate | \
|
||||
jq ".artifacts[] | select(.workflow_run.head_sha == \"${UI_COMMITISH}\" and .name == \"admin-ui-${UI_EDITION}\")" | \
|
||||
jq ".artifacts[] | select(.workflow_run.head_sha == \"${UI_COMMITISH}f\" and .name == \"admin-ui-${UI_EDITION}\")" | \
|
||||
jq --slurp '.[0]' | \
|
||||
jq -r '.id')
|
||||
|
||||
if [[ ${artifact_id} ]]; then
|
||||
if [[ "${artifact_id}" != "null" ]]; then
|
||||
echo "Downloading artifact: ${artifact_id} for admin-ui-${UI_EDITION} ${UI_COMMITISH}"
|
||||
tmp_dir=$(mktemp -d)
|
||||
gh api "repos/hashicorp/${REPO_NAME}/actions/artifacts/${artifact_id}/zip" > "${tmp_dir}/boundary-ui.zip"
|
||||
|
||||
Reference in new issue
Block a user