์คํ๋ ๋์ํธ ์ด์ ์์ #88
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create Feature Branch on Issue Creation | |
| on: | |
| issues: | |
| types: [opened] | |
| jobs: | |
| create-branch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| with: | |
| token: ${{ secrets.TOKEN }} | |
| ref: feature | |
| - name: Create feature branch | |
| env: | |
| ISSUE_NUMBER: ${{ github.event.issue.number }} | |
| ISSUE_TITLE: ${{ github.event.issue.title }} | |
| run: | | |
| # ๋ธ๋์น ์ด๋ฆ ์์ฑ (ํน์๋ฌธ์ ๋ฐ ๊ณต๋ฐฑ ์ฒ๋ฆฌ) | |
| ISSUE_TITLE_CLEAN="${ISSUE_TITLE// /-}" # ๊ณต๋ฐฑ์ '-'๋ก ๋์ฒด | |
| ISSUE_TITLE_CLEAN="${ISSUE_TITLE_CLEAN//[^a-zA-Z0-9๊ฐ-ํฃ_-]/}" # ์๋ฌธ, ํ๊ธ, ์ซ์, '_'๋ง ๋จ๊น | |
| BRANCH_NAME="#${ISSUE_NUMBER}_${ISSUE_TITLE_CLEAN}" | |
| # 'feature' ๋ธ๋์น๋ฅผ ๊ธฐ์ค์ผ๋ก ์ ๋ธ๋์น ์์ฑ ๋ฐ ํธ์ | |
| git checkout feature | |
| git pull origin feature # ์ต์ ์ํ๋ก ์ ๋ฐ์ดํธ | |
| git checkout -b "$BRANCH_NAME" | |
| git push origin "$BRANCH_NAME" |