You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/10/18 21:54:13 UTC

[GitHub] [beam] Abacn commented on a diff in pull request #23703: Fixing branch verification for Run RC Validation and Verify Release Build workflows.

Abacn commented on code in PR #23703:
URL: https://github.com/apache/beam/pull/23703#discussion_r998745076


##########
scripts/ci/ci_check_git_branch.sh:
##########
@@ -16,18 +16,22 @@
 # specific language governing permissions and limitations
 # under the License.
 
-function is_branch() {
-    #if nothing matches show-ref will return an error code of 1
-    if git show-ref --quiet --verify -- "refs/heads/$1" ; then
-      return 1
+function is_in_remote() {
+    local branch=${1}
+    local existed_in_remote=$(git ls-remote --heads origin ${branch})
+
+    if [[ -z ${existed_in_remote} ]]; then
+        return 0
     else
-      return 0
+        return 1
     fi
 }
 
-if is_branch "$1"; then
+if is_in_remote "$1"; then

Review Comment:
   In bash true is 0 and false is non-zero. Is this logic intended?



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org