-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (45 loc) · 1.38 KB
/
code-formatting.yml
File metadata and controls
55 lines (45 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Code Formatting
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
paths:
- '**.java'
- 'build.gradle'
- 'gradle/libs.versions.toml'
jobs:
format:
runs-on: ubuntu-latest
# [skip ci]가 포함된 커밋 메시지는 실행하지 않음 (무한 루프 방지)
if: "!contains(github.event.head_commit.message, '[skip ci]')"
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.GIT_ACCESS_TOKEN }}
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run Spotless Apply
run: ./gradlew spotlessApply
- name: Commit and push if changed
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: apply code formatting [skip ci]'
commit_user_name: github-actions[bot]
commit_user_email: github-actions[bot]@users.noreply.github.com
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>