-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.36 KB
/
ci-linter-swiftlint.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
50
51
52
53
54
# Leka - iOS Monorepo
# Copyright APF France handicap
# SPDX-License-Identifier: Apache-2.0
name: Linter - SwiftLint
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "**/*.swift"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
swift_format:
name: swiftlint
runs-on: [ubuntu-24.04]
permissions:
pull-requests: write
steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
lfs: false
- name: Set up mise
uses: jdx/mise-action@v2
with:
version: 2024.12.4
install: true
cache: true
- name: Run swiftlint
run: |
echo ""
echo "🏃♂️ Running swiftlint on modified files 🤵♂️"
which swiftlint
swiftlint --version
git diff HEAD^1 HEAD --name-only --diff-filter=AMCR \
| grep -E "\.swift\$$" \
|| echo "No files added nor modified!"
git diff HEAD^1 HEAD --name-only --diff-filter=AMCR \
| grep -E "\.swift\$$" \
| xargs --no-run-if-empty swiftlint lint --quiet --reporter github-actions-logging