github.com/grafana/pyroscope@v1.18.0/tools/image-tag (about)

     1  #!/usr/bin/env bash
     2  # SPDX-License-Identifier: AGPL-3.0-only
     3  # Provenance-includes-location: https://github.com/cortexproject/cortex/blob/master/tools/image-tag
     4  # Provenance-includes-license: Apache-2.0
     5  # Provenance-includes-copyright: The Cortex Authors.
     6  
     7  set -o errexit
     8  set -o nounset
     9  set -o pipefail
    10  
    11  WORKING_SUFFIX=$(if git status --porcelain | grep -qE '^(\?:[^\?][^ ]|[^ ][^?])\s'; then echo "-WIP"; else echo ""; fi)
    12  BRANCH_PREFIX=$(git rev-parse --abbrev-ref HEAD)
    13  echo "${BRANCH_PREFIX//\//-}-$(git rev-parse --short HEAD)$WORKING_SUFFIX"