File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,33 +51,28 @@ jobs:
5151 steps :
5252 - name : Checkout
5353 uses : actions/checkout@v3
54- - name : Check which branch belong commit with tag
55- id : check-branch
56- run : |
57- onMainBranch=false
58- onDevelopBranch=false
59- branches=$(git branch -r --contains tags/$GITHUB_REF_NAME)
60- for branch in $branches; do
61- if [[ $branch == "origin/main" ]]; then
62- onMainBranch=true
63- fi
64- if [[ $branch == "origin/develop" ]]; then
65- onDevelopBranch=true
66- fi
67- done
68- echo "onMainBranch=$onMainBranch" >> $GITHUB_OUTPUT
69- echo "onDevelopBranch=$onDevelopBranch" >> $GITHUB_OUTPUT
70- echo $onMainBranch
71- echo $onDevelopBranch
72- shell : bash
54+ with :
55+ fetch-depth : 0
56+ - name : Check if tag belong to commit in main branch
57+ uses : rickstaa/action-contains-tag@v1
58+ id : contains_tag_main
59+ with :
60+ reference : " main"
61+ tag : " ${{ github.ref }}"
62+ - name : Check if tag belong to commit in develop branch
63+ uses : rickstaa/action-contains-tag@v1
64+ id : contains_tag_develop
65+ with :
66+ reference : " develop"
67+ tag : " ${{ github.ref }}"
7368 - name : Release
7469 uses : softprops/action-gh-release@v1
7570 with :
7671 generate_release_notes : true
77- if : ${{ steps.check-branch .outputs.onMainBranch == 'true'}}
72+ if : ${{ steps.contains_tag_main .outputs.retval == 'true'}}
7873 - name : Pre-Release
7974 uses : softprops/action-gh-release@v1
8075 with :
8176 prerelease : true
8277 generate_release_notes : true
83- if : ${{ steps.check-branch .outputs.onDevelopBranch == 'true'}}
78+ if : ${{ steps.contains_tag_develop .outputs.retval == 'true'}}
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ func main() {
4242 }
4343 servingAt := servingAddress + ":" + servingPort
4444 logger .Info ("Start serving http request..." , zap .String ("address" , servingAt ))
45- //Start app forever
45+ //Start app
4646 err := http .ListenAndServe (servingAt , mux )
4747 if err != nil {
4848 logger .Error ("Fail to start http server" , zap .String ("err" , err .Error ()))
You can’t perform that action at this time.
0 commit comments