Skip to content

Feat/#101. ์งˆ๋ฌธ ๊ด€๋ จ(๋ฐœ๊ธ‰, ์กฐํšŒ) ์œ ๋‹›ํ…Œ์ŠคํŠธ ์ž‘์„ฑ #5

Feat/#101. ์งˆ๋ฌธ ๊ด€๋ จ(๋ฐœ๊ธ‰, ์กฐํšŒ) ์œ ๋‹›ํ…Œ์ŠคํŠธ ์ž‘์„ฑ

Feat/#101. ์งˆ๋ฌธ ๊ด€๋ จ(๋ฐœ๊ธ‰, ์กฐํšŒ) ์œ ๋‹›ํ…Œ์ŠคํŠธ ์ž‘์„ฑ #5

# 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 }}