Skip to content

TA-511 Fixing branch not set properly #7

TA-511 Fixing branch not set properly

TA-511 Fixing branch not set properly #7

name: Test workflow 2
# Workflow should run on pushes/merged to develop and release branches.
# These two cases should allow to build release and SNAPSHOT artifacts
on:
push:
branches:
- TA-511-output-branch
env:
JAVA_VERSION: 17
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Generate build number
uses: einaregilsson/build-number@v3
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: displaying build number
run: echo "Build number $BUILD_NUMBER started."
check-current-branch:
runs-on: ubuntu-latest
steps:
- name: check branch
shell: bash
run: |
echo "Setting up branch name"
echo "setting branch to: ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
echo "BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $env:GITHUB_OUTPUT
echo "BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
check-if-branch-is-set:
runs-on: ubuntu-latest
needs:
- check-current-branch
steps:
- name: check branch set
shell: bash
run: |
echo "branch set in the output is: ${{ needs.check-current-branch.outputs.BRANCH }}"
redeploy-environments2:
runs-on: ubuntu-latest
if: needs.check-current-branch.outputs.BRANCH == 'TA-511-output-branch'
needs:
- check-current-branch
steps:
- name: check branch set
shell: bash
run: |
echo "I Run!"