#!/bin/bash

if $BUILD_FROM_SCRATCH ; then
  # retrive git hash
  git_hash=$(git rev-parse --short HEAD)

  # calculate new version
  export "NEW_BUILD_VERSION=$ENV_NAME-$git_hash"
  echo "NEW_BUILD_VERSION=$NEW_BUILD_VERSION" >> $GITHUB_ENV
fi