diff --git a/scripts/release_mod.sh b/scripts/release_mod.sh index 4dee794fdb1..06a306592a7 100755 --- a/scripts/release_mod.sh +++ b/scripts/release_mod.sh @@ -68,7 +68,8 @@ function update_versions_cmd() { } function get_gpg_key { - keyid=$(gpg --list-keys --with-colons| awk -F: '/^pub:/ { print $5 }') + gitemail=$(git config --get user.email) + keyid=$(run gpg --list-keys --with-colons "${gitemail}" | awk -F: '/^pub:/ { print $5 }') if [[ -z "${keyid}" ]]; then log_error "Failed to load gpg key. Is gpg set up correctly for etcd releases?" return 2 @@ -124,4 +125,4 @@ if echo "$0" | grep -E "release_mod.sh$" >/dev/null; then log_info log_warning "WARNING: It was a DRY_RUN. No files were modified." fi -fi \ No newline at end of file +fi diff --git a/scripts/test_lib.sh b/scripts/test_lib.sh index 90844cea23c..f3dec35a349 100644 --- a/scripts/test_lib.sh +++ b/scripts/test_lib.sh @@ -201,7 +201,7 @@ function modules_exp() { # (unless the set is limited using ${PKG} or / ${USERMOD}) function run_for_modules { local pkg="${PKG:-./...}" - if [ -z "${USERMOD}" ]; then + if [ -z "${USERMOD:-}" ]; then for m in $(module_dirs); do run_for_module "${m}" "$@" "${pkg}" || return "$?" done @@ -355,7 +355,9 @@ function assert_no_git_modifications { # - no differencing commits in relation to the origin/$branch function git_assert_branch_in_sync { local branch - branch=$(git branch --show-current) + branch=$(run git rev-parse --abbrev-ref HEAD) + # TODO: When git 2.22 popular, change to: + # branch=$(git branch --show-current) if [[ $(run git status --porcelain --untracked-files=no) ]]; then log_error "The workspace in '$(pwd)' for branch: ${branch} has uncommitted changes" log_error "Consider cleaning up / renaming this directory or (cd $(pwd) && git reset --hard)"