
Pull Request(์ดํ PR)๋ ์คํ์์ค ํ์
๊ณผ ์ฝ๋ ๋ฆฌ๋ทฐ ๊ณผ์ ์์ ํต์ฌ์ ์ธ ์ญํ ์ ํ๋ค.
ํ์ง๋ง PR์ ์๋์ผ๋ก ๊ฒํ ํ๊ณ ๊ด๋ฆฌํ๋ ๋ฐ ์๊ฐ์ด ๋ง์ด ์์๋ ์ ์๋ค.
GitHub Actions๋ฅผ ํ์ฉํ๋ฉด PR ๊ด๋ฆฌ ํ๋ก์ธ์ค๋ฅผ ์๋ํํ ์ ์๋ค.
์ค๋์ GitHub PR ์๋ํ๋ฅผ ์ํ ๊ธฐ๋ณธ์ ์ธ Action ์ค์ ๋ฐฉ๋ฒ์ ์๊ฐํ๋ค.
GitHub Actions๋ CI/CD๋ฅผ ์ํ ์๋ํ ๋๊ตฌ๋ค.
ํน์ ์ด๋ฒคํธ(์: PR ์์ฑ, push ๋ฑ)๊ฐ ๋ฐ์ํ์ ๋ ๋ฏธ๋ฆฌ ์ ์ํ ์ํฌํ๋ก์ฐ๋ฅผ ์คํํ ์ ์๋ค.
.github/workflows ๋๋ ํ ๋ฆฌ ๊ตฌ์กฐ.github/
โโโ workflows/
โโโ pr-check.yml
name: PR ์ ๋ชฉ ๊ฒ์ฌ
on:
pull_request:
types: [opened, edited]
jobs:
check-title:
runs-on: ubuntu-latest
steps:
- name: PR ์ ๋ชฉ ํ์ธ
uses: amannn/action-semantic-pull-request@v5
with:
types: fix, feat, chore, docs, refactor
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
feat:, fix:, docs: ๋ฑ ์ ํด์ง prefix๋ฅผ ๋ฐ๋ผ์ผ ํต๊ณผํจname: PR ๋ผ๋ฒจ ์๋ ์ง์
on:
pull_request:
types: [opened]
jobs:
add-label:
runs-on: ubuntu-latest
steps:
- name: ํน์ ํ์ผ ์์ ์ ๋ผ๋ฒจ ์ถ๊ฐ
uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
labeler.yml ์ค์ ์:
frontend:
- frontend/**
backend:
- backend/**
GITHUB_TOKEN์ ์๋์ผ๋ก ์ ๊ณต๋๋ฉฐ, PR์ ๋ํ ๊ถํ์ ๊ฐ์ง ์ธ์ฆ ํ ํฐ์ด๋ค.action.yml์ ์ ๊ณตํ๋ ์คํ์์ค Action ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ ๊ทน ํ์ฉํ์.