Skip to content

Commit

Permalink
πŸ“¦ chore: lint-pr μ›Œν¬ν”Œλ‘œ μž‘μ„± (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbearcookie authored Jan 26, 2024
1 parent f26b328 commit b27c15b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Lint PR'

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
main:
name: Title Check
runs-on: ubuntu-latest
steps:
- name: PR 타이틀 체크
run: |
title=$(jq -r .pull_request.title "$GITHUB_EVENT_PATH")
valid_types=("✨ feat: " "πŸš‘ fix: " "πŸ’„ design: " "πŸ“ style: " "πŸ”¨ refactor: " "πŸ’‘ comment: " "πŸ“š docs: " "βœ… test: " "πŸ“¦ chore: " "🚚 rename: " "βž– remove: " "πŸš€ deploy: " "πŸŽ‰ init: ")
regex="^($(IFS=\|; echo "${valid_types[*]}"))"
echo "PR 타이틀: $title"
echo "μœ νš¨ν•œ μ •κ·œμ‹: $regex"
if [[ ! $title =~ $regex ]]; then
echo "error: PR 타이틀은 λ‹€μŒ λ¬Έμžμ—΄μ€‘ ν•˜λ‚˜λ‘œ μ‹œμž‘ν•΄μ•Ό ν•΄μš”: ${valid_types[*]}"
exit 1
fi

0 comments on commit b27c15b

Please sign in to comment.