Last updated 1 min read

How to Run SwiftLint From Github Actions

#Swift, #iOS App Development, #Software Engineering

It seems like SwiftLint is no longer preinstalled in Github Actions macOS images anymore.

However, there is still a way to run it effortlessly.

There is a separate SwiftLint Action for it. Here is an example of how to use it:

name: SwiftLint

on:
  push:
    branches: ['main']
  pull_request:
    branches: ['main']

jobs:
  SwiftLint:
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v4
      - uses: cirruslabs/swiftlint-action@v1
        with:
          version: latest

References

GitHub - cirruslabs/swiftlint-action: Run SwiftLint from your GitHub Actions with ease