This commit is contained in:
Manish Gupta 2023-11-07 15:03:56 +05:30
parent 3668b1cc16
commit 896c36f38b

View File

@ -16,11 +16,11 @@ on:
tags: tags:
description: 'Dev/QA Builds' description: 'Dev/QA Builds'
env: env:
gh_branch: ${{ github.ref_name }} gh_branch: ${{ github.ref_name }}
gh_t_branch: ${{ github.event.pull_request.base.ref }} gh_t_branch: ${{ github.event.pull_request.base.ref }}
jobs: jobs:
branch_build_and_push: branch_build_and_push:
if: ${{ (github.event_name == 'pull_request') && (( github.event.action =='closed' && github.event.pull_request.merged == true) || ( github.event.action =='opened'|| github.event.action =='synchronize'))}} if: ${{ (github.event_name == 'pull_request') && (( github.event.action =='closed' && github.event.pull_request.merged == true) || ( github.event.action =='opened'|| github.event.action =='synchronize'))}}
@ -31,19 +31,18 @@ jobs:
- name: Check out the repo - name: Check out the repo
uses: actions/checkout@v3.3.0 uses: actions/checkout@v3.3.0
- name: Set Environment Variable - name: Set Target Branch Name on PR close
run: | if: ${{ github.event_name == 'pull_request' && github.event.action =='closed' }}
if [ ${{ github.event_name }} == 'pull_request' ] && [ ${{github.event.action}} == 'closed' ] ; then run: echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
echo "::set-env name=TRG_BRANCH::${{github.event.pull_request.base.ref}}"
else - name: Set Target Branch Name on other than PR close
echo "::set-env name=TRG_BRANCH::${{github.ref_name}}" if: ${{ github.event.action !='closed' }}
fi run: echo "TARGET_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
- uses: ASzc/change-string-case-action@v2 - uses: ASzc/change-string-case-action@v2
id: gh_branch_upper_lower id: gh_branch_upper_lower
with: with:
string: $TRG_BRANCH string: $TARGET_BRANCH
# string: ${{ env.gh_branch }}
- uses: mad9000/actions-find-and-replace-string@2 - uses: mad9000/actions-find-and-replace-string@2
id: gh_branch_replace_slash id: gh_branch_replace_slash