From 7763b1020d3ca89ba19294172ad524f4ad696386 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Wed, 3 Dec 2025 10:14:51 -0800 Subject: [PATCH 1/2] Add pre-flight checks to release script --- dev-bin/release.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dev-bin/release.sh b/dev-bin/release.sh index c1486ae7..3798f78b 100755 --- a/dev-bin/release.sh +++ b/dev-bin/release.sh @@ -2,6 +2,37 @@ set -eu -o pipefail +# Pre-flight checks - verify all required tools are available and configured +# before making any changes to the repository + +check_command() { + if ! command -v "$1" &> /dev/null; then + echo "Error: $1 is not installed or not in PATH" + exit 1 + fi +} + +# Verify gh CLI is authenticated +if ! gh auth status &> /dev/null; then + echo "Error: gh CLI is not authenticated. Run 'gh auth login' first." + exit 1 +fi + +# Verify we can access this repository via gh +if ! gh repo view --json name &> /dev/null; then + echo "Error: Cannot access repository via gh. Check your authentication and repository access." + exit 1 +fi + +# Verify git can connect to the remote (catches SSH key issues, etc.) +if ! git ls-remote origin &> /dev/null; then + echo "Error: Cannot connect to git remote. Check your git credentials/SSH keys." + exit 1 +fi + +check_command node +check_command npm + # Check that we're not on the main branch current_branch=$(git branch --show-current) if [ "$current_branch" = "main" ]; then From 73471907027401e539a663cf5949001f5c674d43 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Wed, 3 Dec 2025 13:35:15 -0800 Subject: [PATCH 2/2] Fix release script consistency issues --- dev-bin/release.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dev-bin/release.sh b/dev-bin/release.sh index 3798f78b..6cda4e2d 100755 --- a/dev-bin/release.sh +++ b/dev-bin/release.sh @@ -6,26 +6,26 @@ set -eu -o pipefail # before making any changes to the repository check_command() { - if ! command -v "$1" &> /dev/null; then + if ! command -v "$1" &>/dev/null; then echo "Error: $1 is not installed or not in PATH" exit 1 fi } # Verify gh CLI is authenticated -if ! gh auth status &> /dev/null; then +if ! gh auth status &>/dev/null; then echo "Error: gh CLI is not authenticated. Run 'gh auth login' first." exit 1 fi # Verify we can access this repository via gh -if ! gh repo view --json name &> /dev/null; then +if ! gh repo view --json name &>/dev/null; then echo "Error: Cannot access repository via gh. Check your authentication and repository access." exit 1 fi # Verify git can connect to the remote (catches SSH key issues, etc.) -if ! git ls-remote origin &> /dev/null; then +if ! git ls-remote origin &>/dev/null; then echo "Error: Cannot connect to git remote. Check your git credentials/SSH keys." exit 1 fi @@ -104,7 +104,7 @@ git diff echo $'\nRelease notes:' echo "$notes" -read -e -p "Commit changes and create release? (y/n) " should_continue +read -r -e -p "Commit changes and create release? (y/n) " should_continue if [ "$should_continue" != "y" ]; then echo "Aborting"