File tree Expand file tree Collapse file tree 4 files changed +44
-9
lines changed
Expand file tree Collapse file tree 4 files changed +44
-9
lines changed Original file line number Diff line number Diff line change 1+ name : Hotfix
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ tag_version :
7+ description : ' Tag version'
8+ required : true
9+
10+ jobs :
11+ create-branch :
12+ runs-on : ubuntu-latest
13+ if : github.ref == 'refs/heads/main'
14+ steps :
15+ - name : Checkout project
16+ uses : actions/checkout@v4
17+ with :
18+ token : ${{ secrets.CI_CD_TOKEN }}
19+
20+ - name : Create hotfix branch
21+ run : |
22+ START_TAG=v${{ github.event.inputs.tag_version }}
23+ echo "Start from tag $START_TAG"
24+ MAJOR_MINOR_DIGIT=$(echo "$START_TAG" | cut -d '.' -f 1-2)
25+ PATCH_DIGIT=$(echo "$START_TAG" | cut -d '.' -f 3)
26+ NEW_PATCH_DIGIT=$((PATCH_DIGIT + 1))
27+ HOTFIX_VERSION="${MAJOR_MINOR_DIGIT}.${NEW_PATCH_DIGIT}"
28+ HOTFIX_BRANCH_NAME="hotfix/$HOTFIX_VERSION"
29+ echo "Create hotfix branch $HOTFIX_BRANCH_NAME"
30+ git fetch --all
31+ git checkout tags/$START_TAG -b $HOTFIX_BRANCH_NAME
32+ git push origin $HOTFIX_BRANCH_NAME
Original file line number Diff line number Diff line change 1- name : Pull request
1+ name : Pull Request
22
33on :
44 pull_request :
5- branches : [ main ]
5+ branches :
6+ - ' main'
7+ - ' hotfix/v*.*.*'
68
79jobs :
810 build :
2325 distribution : ' temurin'
2426 cache : maven
2527
26- - name : Check Style
28+ - name : Check style
2729 run : mvn checkstyle:check
2830
2931 - name : Build
3234 - name : Test
3335 run : mvn test
3436
35- - name : Publish Test Report
37+ - name : Publish test report
3638 if : always()
3739 uses : mikepenz/action-junit-report@v4
3840 with :
Original file line number Diff line number Diff line change 1- name : Continuous integration
1+ name : Push Main
22
33on :
44 push :
5- branches : [ main ]
5+ branches :
6+ - ' main'
67
78jobs :
89 build :
2829 gpg-private-key : ${{ secrets.GPG_PRIVATE_KEY }}
2930 gpg-passphrase : MAVEN_GPG_PASSPHRASE
3031
31- - name : Check Style
32+ - name : Check style
3233 run : mvn checkstyle:check
3334
3435 - name : Build
4041 - name : Test
4142 run : mvn test
4243
43- - name : Publish Test Report
44+ - name : Publish test report
4445 if : always()
4546 uses : mikepenz/action-junit-report@v4
4647 with :
Original file line number Diff line number Diff line change 1010jobs :
1111 tag :
1212 runs-on : ubuntu-latest
13- if : github.ref == 'refs/heads/main'
13+ if : github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/hotfix/v')
1414 steps :
1515 - name : Checkout project
1616 uses : actions/checkout@v4
You can’t perform that action at this time.
0 commit comments