Hotfix: 추방된 유저에게 개인 메세지 전송 (#302) #440
Workflow file for this run
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"); | |
| } |