-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (42 loc) · 1.38 KB
/
tagging-and-release.yml
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
# Tag 생성 및 Release 생성
name: Versioning - Tagging and Release
on:
pull_request:
branches:
- develop
types:
- closed
jobs:
check-branch:
runs-on: ubuntu-latest
outputs:
current_branch: ${{ steps.branch-name.outputs.current_branch }}
steps:
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v8
# Release 또는 Hotfix 브랜치가 merge 될때 실행
tagging-and-release:
needs: check-branch
runs-on: 'ubuntu-latest'
if: ${{ github.event.pull_request.merged == true && (startsWith(needs.check-branch.outputs.current_branch, 'release/') || startsWith(needs.check-branch.outputs.current_branch, 'hotfix/')) }}
steps:
- name: Get tag
id: get-tag
run: |
branch=${{ needs.check-branch.outputs.current_branch }}
new_tag="${branch#release/}"
new_tag="${new_tag#hotfix/}"
echo "NEW_TAG=$new_tag" >> $GITHUB_OUTPUT
- name: Check tag
run: |
echo ${{ steps.get-tag.outputs.NEW_TAG }}
- name: Create Release & Tag
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
with:
tag_name: ${{ steps.get-tag.outputs.NEW_TAG }}
release_name: ${{ steps.get-tag.outputs.NEW_TAG }}
body: |
${{ github.event.pull_request.body }}