Refactor: 아바타 시스템 DB와 완전 분리 (#302) #437
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: Auto Format PR Title | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, edited] | |
| jobs: | |
| format-title: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Update PR title with issue number from branch | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const pr = context.payload.pull_request; | |
| const branch = pr.head.ref; | |
| // 제목에 이미 (#숫자) 패턴이 있는지 먼저 확인 | |
| const hasIssueTag = /\(#\d+\)$/.test(pr.title); | |
| if (hasIssueTag) { | |
| console.log(`✅ PR title already has issue tag, skipping update`); | |
| return; | |
| } | |
| // 브랜치 명에서 숫자 추출 | |
| const issueMatch = branch.match(/(\d+)/); | |
| if (issueMatch) { | |
| const newTitle = `${pr.title} (#${issueMatch[1]})`; | |
| console.log(`✏️ Updating PR title: ${newTitle}`); | |
| await github.rest.pulls.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: pr.number, | |
| title: newTitle | |
| }); | |
| } else { | |
| console.log("⚠️ No issue number found in branch name"); | |
| } |