File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Test workflow
2+
3+ on :
4+ push :
5+ branches :
6+ - TA-511-fix-workflow
7+
8+ env :
9+ JAVA_VERSION : 17
10+ BRANCH : " "
11+
12+ jobs :
13+ build :
14+ runs-on : ubuntu-22.04
15+ steps :
16+ - uses : actions/checkout@v4
17+ - name : Generate build number
18+ uses : einaregilsson/build-number@v3
19+ with :
20+ token : ${{secrets.ACCESS_TOKEN}}
21+
22+ check-current-branch :
23+ runs-on : ubuntu-22.04
24+ steps :
25+ - name : check branch
26+ shell : bash
27+ run : |
28+ echo "Setting up branch name"
29+ echo "envs: ${{ toJson(env) }}"
30+ echo "BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
31+ echo "envs: ${{ toJson(env) }}"
32+ branch="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
33+ echo="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
34+ echo "BRANCH1=${GITHUB_HEAD_REF}"
35+ echo "BRANCH2=${GITHUB_REF#refs/heads/}"
36+ echo "BRANCH=$branch" >> $GITHUB_ENV
37+ echo "envs: ${{ toJson(env) }}"
38+ echo "BRANCH = ${{ env.BRANCH }}"
39+ - name : test1
40+ if : env.BRANCH == 'develop'
41+ shell : brash
42+ run : |
43+ echo "This is develop"
44+ - name : test2
45+ if : env.BRANCH == 'A-511-fix-workflow'
46+ shell : brash
47+ run : |
48+ echo "This is A-511-fix-workflow"
You can’t perform that action at this time.
0 commit comments