Skip to content

Commit

Permalink
chore(IDX): fix some shellcheck warnings in main.sh (#4053)
Browse files Browse the repository at this point in the history
This removes an outdated comment and fixes some shellcheck warnings from
`ci/bazel-scripts/main.sh`.
  • Loading branch information
nmattia authored Feb 24, 2025
1 parent fbd8400 commit cca8d6f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ci/bazel-scripts/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ if [ -n "${CLOUD_CREDENTIALS_CONTENT+x}" ]; then
unset CLOUD_CREDENTIALS_CONTENT
fi

if [ -z "${KUBECONFIG:-}" ] && [ ! -z "${KUBECONFIG_TNET_CREATOR_LN1:-}" ]; then
export KUBECONFIG=$(mktemp -t kubeconfig-XXXXXX)
echo $KUBECONFIG_TNET_CREATOR_LN1 >$KUBECONFIG
if [ -z "${KUBECONFIG:-}" ] && [ -n "${KUBECONFIG_TNET_CREATOR_LN1:-}" ]; then
KUBECONFIG=$(mktemp -t kubeconfig-XXXXXX)
export KUBECONFIG
echo "$KUBECONFIG_TNET_CREATOR_LN1" >"$KUBECONFIG"
trap 'rm -f -- "$KUBECONFIG"' EXIT
fi

Expand Down Expand Up @@ -102,14 +103,12 @@ if [[ ! " ${bazel_args[*]} " =~ [[:space:]]--repository_cache[[:space:]] ]] && [
bazel_args+=(--repository_cache=/cache/bazel)
fi

# shellcheck disable=SC2086
# ${BAZEL_...} variables are expected to contain several arguments. We have `set -f` set above to disable globbing (and therefore only allow splitting)"
bazel "${bazel_args[@]}" 2>&1 | awk -v url_out="$url_out" "$stream_awk_program"

# Write the bes link & summary
echo "Build results uploaded to $(<"$url_out")"
if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
invocation=$(sed <"$url_out" 's;.*/;;') # grab invocation ID (last url part)
echo "BuildBuddy [$invocation]($(<"$url_out"))" >>$GITHUB_STEP_SUMMARY
echo "BuildBuddy [$invocation]($(<"$url_out"))" >>"$GITHUB_STEP_SUMMARY"
fi
rm "$url_out"

0 comments on commit cca8d6f

Please sign in to comment.