Skip to content

Commit 768e402

Browse files
authored
Merge pull request #1 from TTOzzi/feature/configure-git
[NONE]: PR 템플릿, author 자동 assign action 추가
2 parents 8a53973 + 790a11a commit 768e402

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## 티켓 링크
2+
3+
## 구현내용
4+
5+
## 고민사항
6+
7+
## 기타

.github/auto_assign.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
addAssignees: author

.github/workflows/auto-assign.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: 'Auto Assign'
2+
on:
3+
pull_request:
4+
types: [opened, ready_for_review]
5+
6+
jobs:
7+
assign:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: kentaro-m/[email protected]

.github/workflows/format.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Format
2+
3+
# 실행 조건 = push + pull_reqeust
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- develop
9+
pull_request:
10+
branches:
11+
- main
12+
- develop
13+
14+
# 기존 실행중인 work_flow 중지
15+
concurrency:
16+
group: format-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
swift_format:
21+
name: swift-format
22+
runs-on: macos-15
23+
permissions:
24+
contents: write
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Select Xcode 16.2
30+
run: sudo xcode-select -s /Applications/Xcode_16.2.app
31+
32+
# cache 확인 후 swift-format 설치
33+
- name: Restore swift-format cache
34+
uses: actions/cache@v4
35+
with:
36+
path: ~/.build_swift_format
37+
key: swift-format-${{ runner.os }}-${{ hashFiles('**/Package.resolved') }}
38+
39+
- name: Setup swift-format
40+
run: |
41+
if [ ! -f ~/.build_swift_format/swift-format ]; then
42+
git clone https://github.com/apple/swift-format.git
43+
cd swift-format
44+
swift build -c release --disable-sandbox
45+
mkdir -p ~/.build_swift_format
46+
cp .build/release/swift-format ~/.build_swift_format/swift-format
47+
cd ..
48+
fi
49+
50+
sudo cp ~/.build_swift_format/swift-format /usr/local/bin/swift-format
51+
swift-format --version || echo "swift-format installed"
52+
53+
# swift-format 실행
54+
# .swift 파일에 대해서만 실행
55+
- name: Run swift-format
56+
run: |
57+
find . \
58+
-path '*/Documentation.docc' -prune -o \
59+
-name '*.swift' \
60+
-not -path '*/.*' -print0 \
61+
| xargs -0 swift-format --ignore-unparsable-files --in-place
62+
63+
- uses: stefanzweifel/git-auto-commit-action@v5
64+
with:
65+
commit_message: '[Auto] Run swift-format'
66+
branch: 'main'

0 commit comments

Comments
 (0)