From 68effc90bcb7dff98ad9e4cefe4978738dd594f3 Mon Sep 17 00:00:00 2001 From: Yaswant Pradhan <2984440+yaswant@users.noreply.github.com> Date: Thu, 2 Jul 2026 11:24:47 +0100 Subject: [PATCH] Add repository verification to tagman script --- sbin/tagman | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sbin/tagman b/sbin/tagman index fcad92ab..575c37ed 100755 --- a/sbin/tagman +++ b/sbin/tagman @@ -108,6 +108,14 @@ run() { trap cleanup EXIT ERR SIGINT +verify_repo() { + # gh repo view seems to be fastest (vs. gh api call or native git ls-remote command) + if ! gh repo view "$REPO" --json id >/dev/null 2>&1; then + echo -e "${RED}** Repository '$REPO' not found or inaccessible.${NO_COLOR}" + exit 1 + fi +} + verify_tag() { if gh api "repos/${REPO}/git/refs/tags/${TAG}" >/dev/null 2>&1; then echo -e "${YELLOW}Tag '$TAG' exists in repository '$REPO'.${NO_COLOR}" @@ -328,6 +336,7 @@ parse_args() { main() { parse_args "$@" + verify_repo case "$ACTION" in add) add_tag ;;