-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.49 KB
/
test-workflow2.yml
File metadata and controls
54 lines (49 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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!"