#!/bin/bash

bucket_name="p81-devops"
file_path="files/solo-lock/lock"

source $ROOT_PATH/scripts/common.sh

msg="Deployments to SOLO env are blocked. Run release workflow to unlock and automatically deploy the latest version of micro-service"

aws s3api head-object --bucket "$bucket_name" --key "$file_path" 2>&1
if [ "$?" == "0" ]; then
  if [ -n "$END_WORKFLOW" ]; then
    handle_error "$msg"
   else
    echo_yellow_bg "$msg"
    echo "END_WORKFLOW=true" >> $GITHUB_ENV
  fi
fi