From 4d92f8c8df9ef0701f73ec1ff3bd22aa43e6d307 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 11 Sep 2026 10:20:55 +0200 Subject: [PATCH] Add pr-approve script --- hack/pr-approve.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 hack/pr-approve.sh diff --git a/hack/pr-approve.sh b/hack/pr-approve.sh new file mode 100755 index 000000000..782a9710d --- /dev/null +++ b/hack/pr-approve.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat < + +Post three separate comments on a GitHub PR: + 1) /ok-to-test + 2) /lgtm + 3) /approve +EOF +} + +if [[ $# -lt 1 ]]; then + usage + exit 1 +fi + +if ! command -v gh >/dev/null 2>&1; then + echo "error: gh CLI is required but was not found in PATH" >&2 + exit 1 +fi + +PR="$1" + +for comment in "/ok-to-test" "/lgtm" "/approve"; do + echo "Posting comment: ${comment}" + gh pr comment "${PR}" --body "${comment}" +done + +echo "Done. Posted /ok-to-test, /lgtm, and /approve on ${PR}."