From f30bda360340da9fa4e057a7eff6887d3f785799 Mon Sep 17 00:00:00 2001 From: ginaseo Date: Thu, 30 Jul 2026 23:39:51 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EC=9D=B4=EC=8A=88/PR=20=ED=85=9C?= =?UTF-8?q?=ED=94=8C=EB=A6=BF=20+=20=EC=A0=9C=EB=AA=A9=20prefix=20?= =?UTF-8?q?=EA=B8=B0=EB=B0=98=20=EB=9D=BC=EB=B2=A8=20=EC=9E=90=EB=8F=99?= =?UTF-8?q?=ED=99=94=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 이슈 템플릿 2개(fix:/feat: prefix + labels 기본값 + 기능설명·작업내용·참고문서 3섹션), PR 템플릿, title prefix(feat:/fix:/docs:) 보고 기존 라벨(enhancement/bug/documentation) 자동 부착하는 워크플로 --- .github/ISSUE_TEMPLATE/bug_report.md | 18 +++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 18 +++++++++++ .github/pull_request_template.md | 11 +++++++ .github/workflows/label-by-title.yml | 38 +++++++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/label-by-title.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..31eec73 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,18 @@ +--- +name: 버그 리포트 +about: 버그나 오작동을 보고한다 +title: "fix: " +labels: bug +--- + +## 기능 설명 + + + +## 작업내용 + + + +## 참고문서 + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..ebd4569 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,18 @@ +--- +name: 기능 요청 +about: 새 기능이나 개선을 제안한다 +title: "feat: " +labels: enhancement +--- + +## 기능 설명 + + + +## 작업내용 + + + +## 참고문서 + + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..dfee134 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,11 @@ +## 요약 + + + +## 테스트 + + + +## 참고문서 + + diff --git a/.github/workflows/label-by-title.yml b/.github/workflows/label-by-title.yml new file mode 100644 index 0000000..e5c27d3 --- /dev/null +++ b/.github/workflows/label-by-title.yml @@ -0,0 +1,38 @@ +name: Label by title prefix + +on: + issues: + types: [opened, edited] + pull_request: + types: [opened, edited] + +permissions: + issues: write + pull-requests: write + +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v7 + with: + script: | + const prefixToLabel = { + feat: "enhancement", + fix: "bug", + docs: "documentation", + }; + + const item = context.payload.issue ?? context.payload.pull_request; + const match = item.title.match(/^(\w+):/); + if (!match) return; + + const label = prefixToLabel[match[1]]; + if (!label) return; + + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: item.number, + labels: [label], + });