Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
KangTaeHoon committed Sep 7, 2024
2 parents 10ca6b3 + 2e2128c commit 47bd25a
Show file tree
Hide file tree
Showing 2,967 changed files with 56,205 additions and 296,539 deletions.
2 changes: 2 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[core]
hookspath = .githooks
43 changes: 43 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/sh

FORMAT=$(which swiftformat)

if [[ -e "${FORMAT}" ]]; then
echo "🚀 SwiftFormat 시작..."
echo "🔍 SwiftFormat 적용 경로: $(pwd)/Projects"
else
echo "SwiftFormat이 존재하지 않습니다. 설치해주세요 ! 'brew install swiftformat'"
exit 1
fi

RESULT=$($FORMAT ./Projects --config .swiftformat)

if [ "$RESULT" == '' ]; then
git add .
git commit -m "🎨 :: 코드 Formatting 적용"
printf "\n 🎉 SwiftFormat 적용을 완료했습니다 !! \n"
else
echo ""
printf "❌ SwiftFormat Failed 아래 내용을 확인해주세요 \n"
while read -r line; do
FILEPATH=$(echo $line | cut -d : -f 1)
L=$(echo $line | cut -d : -f 2)
C=$(echo $line | cut -d : -f 3)
TYPE=$(echo $line | cut -d : -f 4 | cut -c 2-)
MESSAGE=$(echo $line | cut -d : -f 5 | cut -c 2-)
DESCRIPTION=$(echo $line | cut -d : -f 6 | cut -c 2-)
if [ $TYPE == 'warning' ]; then
printf "\n 🚧 $TYPE\n"
printf " $FILEPATH:$L:$C\n"
printf " 📌 $MESSAGE: - $DESCRIPTION\n"
exit 0
elif [ $TYPE == 'error' ]; then
printf "\n 🚨 $TYPE\n"
fi
printf "$FILEPATH:$L:$C\n"
printf " 📌 $MESSAGE: - $DESCRIPTION\n"
done <<< "$RESULT"

printf "\n 🚑 커밋실패!! SwiftFormat 실행이 실패하였습니다 🥺 \n"
exit 1
fi
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @yongbeomkwak @kimdaehee0824 @CoCoE1203 @KangTaeHoon @youn9k
* @yongbeomkwak @kimdaehee0824 @KangTaeHoon @youn9k @baekteun
41 changes: 38 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
## 💡 배경 및 개요

## 개요
<!--
> PR을 하게 된 문제상황, 배경 등 개요에 대해서 작성해주세요!
>
> 퍼블리싱의 경우 스크린샷/동영상도 추가해주면 좋아요!
-->

## 작업사항
<!-- resolved issue 넘버 표기 방식 변경 시 '.github/actions/Auto_close_associate_issue/main.js' 또한 변경 필요 -->

Closes #이슈번호
Resolves: #{이슈번호}

## 📃 작업내용

<!--
> PR에서 한 작업을 자세히 작성해주세요!
-->

## 🙋‍♂️ 리뷰노트

<!--
> 구현 시에 고민이었던 점들 혹은 특정 부분에 대한 의도가 있었다면 PR 리뷰의 이해를 돕기 위해 서술해주세요!
>
> 또한 리뷰어에게 특정 부분에 대한 집중 혹은 코멘트 혹은 질문을 요청하는 경우에 작성하면 좋아요!
>
> e.g. 작업을 끝내야할 시간이 얼마 없어 확장성보다는 동작을 위주로 만들었어요! 감안하고 리뷰해주세요!
-->

## ✅ PR 체크리스트

<!--
> 템플릿 체크리스트 말고도 추가적으로 필요한 체크리스트는 추가해주세요!
-->

- [ ] 이 작업으로 인해 변경이 필요한 문서가 변경되었나요? (e.g. `XCConfig`, `노션`, `README`)
- [ ] 이 작업을 하고나서 공유해야할 팀원들에게 공유되었나요? (e.g. `"API 개발 완료됐어요"`, `"XCConfig 값 추가되었어요"`)
- [ ] 작업한 코드가 정상적으로 동작하나요?
- [ ] Merge 대상 브랜치가 올바른가요?
- [ ] PR과 관련 없는 작업이 있지는 않나요?

## 🎸 기타
5 changes: 5 additions & 0 deletions .github/actions/Auto_close_associate_issue/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM node:20.14

COPY . .

CMD [ "node", "/main.js"]
16 changes: 16 additions & 0 deletions .github/actions/Auto_close_associate_issue/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Auto_close_associate_issue"

description: "Auto close an issue which associate with a PR."

inputs:
prbody:
description: "The body of the PR to search for related issues"
required: true

outputs:
issurNumber:
description: "The issue number"

runs:
using: "docker"
image: "Dockerfile"
16 changes: 16 additions & 0 deletions .github/actions/Auto_close_associate_issue/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
let body = process.env["INPUT_PRBODY"];

/*
PR Template의 resolved issue 넘버 표기 방식 변경 시 해당 코드 또한 변경 필요
*/
let pattern = /Resolves: #\d+/;

let issueNumber;

try {
issueNumber = body.match(pattern)[0].replace("Resolves: #", "").trim();
} catch {
issueNumber = -1;
}

console.log(`::set-output name=issueNumber::${issueNumber}`);
40 changes: 40 additions & 0 deletions .github/workflows/AutoAssign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Auto assign PR author

on:
pull_request:
types:
- opened
- reopened

jobs:
assign-pr-author:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get PR author
id: get-pr-author
run: echo "author=${{ github.event.pull_request.user.login }}" >> $GITHUB_OUTPUT

- name: Assign PR author
run: gh pr edit ${{ github.event.number }} --add-assignee ${{ steps.get-pr-author.outputs.author }}
env:
GH_TOKEN: ${{ github.token }}

- name: Comment success result to PR
uses: mshick/add-pr-comment@v2
if: ${{ success() }}
with:
message: |
## ✅ Assign 자동 지정을 성공했어요!
@${{ steps.get-pr-author.outputs.author }}
allow-repeats: true

- name: Comment failure result to PR
uses: mshick/add-pr-comment@v2
if: ${{ failure() }}
with:
message: "## ❌ PR의 Assign 자동 지정을 실패했어요."
allow-repeats: true
31 changes: 31 additions & 0 deletions .github/workflows/AutoCloseIssueByPullRequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Auto close issue when PR is merged

on:
pull_request_target:
branches-ignore:
- "develop"
types: [closed]

jobs:
close-issue:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true || github.event.action != 'closed'
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Run Auto issue closer
uses: ./.github/actions/Auto_close_associate_issue/
id: Closer
with:
prbody: ${{ github.event.pull_request.body }}

- name: Close Issue
uses: peter-evans/close-issue@v2
if: ${{ github.event.pull_request.merged }}
with:
issue-number: ${{ steps.Closer.outputs.issueNumber }}
comment: The associated PR has been merged, this issue is automatically closed, you can reopend if necessary. \#${{ github.event.pull_request.number }}
env:
Github_Token: ${{ secrets.GITHUB_TOKEN }}
PRNUM: ${{ github.event.pull_request.number }}
Loading

0 comments on commit 47bd25a

Please sign in to comment.