-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (46 loc) · 1.55 KB
/
pr-compliance-check.yml
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
name: "Check PR complains with requirements"
on:
pull_request_target:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
reviewdog:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version-file: .java-version
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper
- name: Setup format tools
run: |
export KTLINT_VERSION=1.3.1
mkdir ${HOME}/.local/bin
echo "Installing ktlint $KTLINT_VERSION"
curl -sSLO "https://github.com/pinterest/ktlint/releases/download/$KTLINT_VERSION/ktlint" && chmod a+x ktlint && mv ktlint ${HOME}/.local/bin/
ktlint --version
- name: 'Checkout PR'
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run reviewdog ktlint
run: >
ktlint '**/*.kt' '**/*.kts' '!**/build/generated*/**' |
reviewdog -tee -reporter=github-pr-review -log-level=debug -efm="%f:%l:%c: %m" -name=ktlint
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}