diff --git a/.github/workflows/verify_upstream.sh b/.github/workflows/verify_upstream.sh index 3e8a38ac2..8444eba57 100644 --- a/.github/workflows/verify_upstream.sh +++ b/.github/workflows/verify_upstream.sh @@ -5,7 +5,7 @@ set -eu +o pipefail # Example output of `git status -sb`: # ## master...origin/master [behind 1] # M .github/workflows/verify_upstream.sh -UPSTREAM_BRANCH_NAME="$(git status -sb | head -n 1 | cut -d' ' -f2 | grep -E '\.{3}' | cut -d'.' -f4)" +UPSTREAM_BRANCH_NAME="$(git status -sb | head -n 1 | awk -F '\\.\\.\\.' '{print $2}' | cut -d ' ' -f1)" printf '%s\n' "Upstream branch name: $UPSTREAM_BRANCH_NAME" set -o pipefail diff --git a/docs/configuration/automatic-releases/github-actions.rst b/docs/configuration/automatic-releases/github-actions.rst index 57cd7b507..a46bb1460 100644 --- a/docs/configuration/automatic-releases/github-actions.rst +++ b/docs/configuration/automatic-releases/github-actions.rst @@ -903,7 +903,7 @@ to the GitHub Release Assets as well. run: | set +o pipefail - UPSTREAM_BRANCH_NAME="$(git status -sb | head -n 1 | cut -d' ' -f2 | grep -E '\.{3}' | cut -d'.' -f4)" + UPSTREAM_BRANCH_NAME="$(git status -sb | head -n 1 | awk -F '\\.\\.\\.' '{print $2}' | cut -d ' ' -f1)" printf '%s\n' "Upstream branch name: $UPSTREAM_BRANCH_NAME" set -o pipefail