Copilot commented on code in PR #10449:
URL: https://github.com/apache/gravitino/pull/10449#discussion_r2945074468


##########
dev/release/do-release.sh:
##########
@@ -20,22 +22,46 @@
 # Referred from Apache Spark's release script
 # dev/create-release/do-release.sh
 
-SELF=$(cd $(dirname $0) && pwd)
+RUNNING_IN_DOCKER=${RUNNING_IN_DOCKER:-0}
+
+SELF=$(cd "$(dirname "$0")" && pwd)
 
-while getopts ":b:n" opt; do
+while getopts ":b:s:p:t:r:nyh" opt; do
   case $opt in
     b) GIT_BRANCH=$OPTARG ;;
     n) DRY_RUN=1 ;;
+    s) RELEASE_STEP=$OPTARG ;;
+    p) GPG_PASSPHRASE=$OPTARG ;;
+    t) ASF_PASSWORD=$OPTARG ;;
+    r) RC_COUNT=$OPTARG ;;
+    y) FORCE=1 ;;
+    h)
+      echo "Usage: $0 [options]"
+      echo "Options:"
+      echo "  -b <branch>   Git branch to release (e.g., branch-1.2)"
+      echo "  -s <step>     Release step to execute: tag, build, docs, 
publish, finalize"
+      echo "  -r <num>      Release candidate number (e.g., 6 for rc6)"
+      echo "  -n            Dry run mode"
+      echo "  -p <pass>     GPG passphrase"
+      echo "  -t <pass>     ASF password"
+      echo "  -y            Force continue without confirmation"
+      echo "  -h            Show this help message"
+      exit 0
+      ;;
     \?) error "Invalid option: $OPTARG" ;;
   esac
 done
 
-DRY_RUN=${DRY_RUN:-0}
-export DRY_RUN
+export DRY_RUN=${DRY_RUN:-0}
+export FORCE=${FORCE:-0}
+export RC_COUNT=${RC_COUNT:-0}
+export RELEASE_STEP=${RELEASE_STEP:-}
+
+echo "DRY_RUN=$DRY_RUN FORCE=$FORCE RC_COUNT=$RC_COUNT 
RELEASE_STEP=$RELEASE_STEP"
 
 cmds=("git" "gpg" "svn" "twine" "shasum" "sha1sum" "jq" "make")
 for cmd in "${cmds[@]}"; do

Review Comment:
   Because `set -u` is enabled, later checks like `[[ -z "$PYPI_API_TOKEN" ]]` 
will throw an “unbound variable” error when the variable is unset, instead of 
hitting the intended friendly message/exit path. Use `${PYPI_API_TOKEN:-}` (or 
initialize it) anywhere it’s read under nounset.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to