Repository navigation
[FEAT] 오늘 페이지 모바일 반응형 대응 #197
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 Issue | |
| on: | |
| issues: | |
| types: [opened, edited, reopened] | |
| permissions: | |
| issues: write | |
| jobs: | |
| label-by-prefix: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const title = context.payload.issue.title; | |
| const prefixMap = { | |
| '[FEAT]': '✨ Feature', | |
| '[FIX]': '🐛 Bug', | |
| '[CHORE]': '🧹 CHORE', | |
| '[INIT]': '🛠️ Setup', | |
| '[DOCS]': '📝 Docs', | |
| '[CI]': '😎 DevOps', | |
| '[TEST]': '🌊 TEST', | |
| '[REFACTOR]': '♻ Refactor', | |
| '[UI]': '⌚ Timo-Design-system', | |
| '[STYLE]': '⌚ Timo-Design-system', | |
| '[PERF]': '✨ Feature', | |
| '[API]': '🌟 API', | |
| }; | |
| // edited 이벤트는 본문 수정만으로도 트리거되므로 제목 변경 여부를 확인 | |
| if (context.payload.action === 'edited' && !context.payload.changes?.title) return; | |
| const allPrefixLabels = [...new Set(Object.values(prefixMap))]; | |
| const match = Object.entries(prefixMap).find(([prefix]) => title.startsWith(prefix)); | |
| const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.issue.number, | |
| }); | |
| for (const label of currentLabels) { | |
| if (allPrefixLabels.includes(label.name)) { | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.issue.number, | |
| name: label.name, | |
| }); | |
| } | |
| } | |
| if (!match) return; | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.issue.number, | |
| labels: [match[1]], | |
| }); | |
| self-assign: | |
| if: github.event.action == 'opened' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| await github.rest.issues.addAssignees({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.issue.number, | |
| assignees: [context.payload.issue.user.login], | |
| }); |