@@ -10,6 +10,7 @@ GCS_BASE="https://storage.googleapis.com/test-platform-results"
1010PROW_VIEW=" https://prow.ci.openshift.org/view/gs/test-platform-results"
1111GH_REPO=" openshift/microshift"
1212GCS_PR_PREFIX=" pr-logs/pull/openshift_microshift"
13+ SIGNATURE=$' \n ' " *Added by $( basename " ${0} " ) * :robot:" $' \n '
1314
1415# Get open PRs using GitHub CLI, optionally filtered by title substring and/or author
1516fetch_open_prs () {
@@ -265,8 +266,11 @@ mode_approve() {
265266 fi
266267
267268 if [[ " ${success} " -eq " ${total} " ]]; then
269+ local comment=$' /lgtm\n /verified by ci\n '
270+ comment+=" ${SIGNATURE} "
271+
268272 echo " PR #${pr_number} : All ${total} jobs passed, approving..."
269- gh pr comment " ${pr_number} " --repo " ${GH_REPO} " --body $' /lgtm \n /verified by ci '
273+ gh pr comment " ${pr_number} " --repo " ${GH_REPO} " --body " ${comment} "
270274 echo " PR #${pr_number} : Approved"
271275 else
272276 echo " PR #${pr_number} : ${success} /${total} jobs passed, skipping"
@@ -332,8 +336,12 @@ mode_restart() {
332336 [[ -z " ${short_name} " ]] && continue
333337 comment+=" /test ${short_name} " $' \n '
334338 done
335- # Remove trailing newline
336- comment=" ${comment% $' \n ' } "
339+
340+ if [[ -z " ${comment} " ]]; then
341+ echo " PR #${pr_number} : Could not resolve rerun commands for failed job(s), skipping"
342+ continue
343+ fi
344+ comment+=" ${SIGNATURE} "
337345
338346 echo " PR #${pr_number} : Restarting ${# failed_jobs[@]} failed job(s): ${failed_jobs[*]} "
339347 gh pr comment " ${pr_number} " --repo " ${GH_REPO} " --body " ${comment} "
0 commit comments