diff --git a/bin/push-to-prod.sh b/bin/push-to-prod.sh index 3744c00..6aa8e61 100755 --- a/bin/push-to-prod.sh +++ b/bin/push-to-prod.sh @@ -1,6 +1,12 @@ -#!/bin/bash +#!/usr/bin/env bash # push main to prod (which will trigger the deploy action) -git checkout prod -git merge --ff-only main -git push origin prod -git checkout main +CURR_BRANCH=$(git symbolic-ref --short HEAD) +if [[ ${CURR_BRANCH} == "main" ]]; then + echo pushing main to prod... + git checkout prod + git merge --ff-only main + git push origin prod + git checkout main +else + echo "This script is meant to be run from the main branch!" +fi