diff --git a/.github/workflows/warp_release.yml b/.github/workflows/warp_release.yml index 495c047f7b..37d1c0e3b7 100644 --- a/.github/workflows/warp_release.yml +++ b/.github/workflows/warp_release.yml @@ -1,4 +1,3 @@ - # This action releases from develop/master for all changed pipelines name: WARP Release @@ -40,16 +39,20 @@ jobs: run: | source scripts/common.sh set -e - if [[ "${GIT_BRANCH}" == "develop" ]]; then + BRANCH_NAME=$(echo "${GITHUB_REF#refs/heads/}") + if [[ "${BRANCH_NAME}" == "develop" ]]; then ENV=dev - elif [[ "${GIT_BRANCH}" == "master" ]]; then + elif [[ "${BRANCH_NAME}" == "master" ]]; then ENV=prod + else + echo "Error: Branch ${BRANCH_NAME} is not a valid release branch." + exit 1 fi echo $ENV echo "Getting all changed pipelines since last commit before releasing from develop" previous_commit_hash=$(git rev-parse HEAD^1) changed_pipelines=$(get_modified_pipelines ${previous_commit_hash}) - echo branch: ${GIT_BRANCH} previous_commit_hash: ${previous_commit_hash} env: ${ENV} + echo branch: ${BRANCH_NAME} previous_commit_hash: ${previous_commit_hash} env: ${ENV} if [[ -n ${ENV} ]]; then if [[ -n ${changed_pipelines[@]} ]]; then for pipeline in ${changed_pipelines[@]}; do @@ -62,6 +65,4 @@ jobs: echo "Releases are only made on merge to develop and master" fi env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file