github.com/letsencrypt/boulder@v0.20251208.0/tools/verify-release-ancestry.sh (about)

     1  #!/usr/bin/env bash
     2  #
     3  # Usage: verify-release-ancestry.sh <commit hash>
     4  #
     5  # Exits zero if the provided commit is either an ancestor of main or equal to a
     6  # hotfix branch (release-branch-*). Exits 1 otherwise.
     7  #
     8  set -u
     9  
    10  if git merge-base --is-ancestor "$1" origin/main ; then
    11    echo "'$1' is an ancestor of main"
    12    exit 0
    13  elif git for-each-ref --points-at="$1" "refs/remotes/origin/release-branch-*" | grep -q "^$1.commit.refs/remotes/origin/release-branch-" ; then
    14    echo "'$1' is equal to the tip of a hotfix branch (release-branch-*)"
    15    exit 0
    16  else
    17    echo
    18    echo "Commit '$1' is neither an ancestor of main nor equal to a hotfix branch (release-branch-*)"
    19    echo
    20    exit 1
    21  fi