Merge pull request #21544 from medyagh/iso_fail_comment_fix

ci: fix failed ISO not commenting on PR
pull/21645/head
Medya Ghazizadeh 2025-09-26 12:56:22 -07:00 committed by GitHub
commit dfb4f364ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 10 deletions

View File

@ -65,16 +65,23 @@ else
export ISO_BUCKET
fi
make release-iso | tee iso-logs.txt
# Abort with error message if above command failed
ec=$?
if [ $ec -gt 0 ]; then
if [ "$release" = false ]; then
gh pr comment ${ghprbPullId} --body "Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed.
See the logs at: https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt
if ! make release-iso 2>&1 | tee iso-logs.txt; then
# Exit of `make` (PIPESTATUS[0]); fallback to 1 if unavailable
ec=${PIPESTATUS[0]:-1}
# Only comment on non-release; default release=false if unset
if [[ ${release:-false} != "true" ]]; then
body="$(cat <<'EOF'
Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed for Commit ${ghprbActualCommit}
See the logs at:
https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt
EOF
"
gh pr comment "${ghprbPullId}" --body "$body"
fi
exit $ec
exit "$ec"
fi
git config user.name "minikube-bot"