Skip to content

chore(deps): update dependency org.jlleitschuh.gradle.ktlint to v12.1.2 #517

chore(deps): update dependency org.jlleitschuh.gradle.ktlint to v12.1.2

chore(deps): update dependency org.jlleitschuh.gradle.ktlint to v12.1.2 #517

Workflow file for this run

name: Kotlin-Linter
on:
pull_request:
jobs:
ktlint:
runs-on: macos-13
steps:
- name: Get changed files
id: changes
run: |
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
RESPONSE=$(curl -s -X GET -G $URL --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}')
CHANGED_KOTLIN_FILES=$(echo $RESPONSE | jq -r '.[] | .filename' | grep -E "\.kt$" | tr \'\\n\' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')
echo "Changed Kotlin files: ${CHANGED_KOTLIN_FILES}"
echo "changed_kotlin_files=${CHANGED_KOTLIN_FILES}" >> $GITHUB_ENV
- name: "checkout"
if: env.changed_kotlin_files != ''
uses: actions/checkout@v4
- name: Install ktlint
if: env.changed_kotlin_files != ''
run: |
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.2.1/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
- name: run ktlint
if: env.changed_kotlin_files != ''
run: |
ktlint . '!**/build/**'