Files
moeka-project/.github/actions/setup-swiftlint
815ce36bce fix(stage-*): OpenAI Compatible Speech and Hearing modules activation (#947)
---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Neko <neko@ayaka.moe>
2026-01-17 00:16:42 +08:00
..
2026-01-04 01:47:22 +08:00

Setup SwiftLint Action

A reusable GitHub Action that downloads and installs SwiftLint binary from SwiftLint releases to /usr/bin.

Usage

Basic usage

- uses: ./.github/actions/setup-swiftlint

This will install the latest version of SwiftLint.

Specify version

- uses: ./.github/actions/setup-swiftlint
  with:
    version: '0.58.2'

Or use version with v prefix:

- uses: ./.github/actions/setup-swiftlint
  with:
    version: 'v0.58.2'

Inputs

Input Description Required Default
version SwiftLint version (e.g., 0.58.2). If not specified, the latest version will be used No latest

Example workflow

name: CI

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

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      - name: Install SwiftLint
        uses: ./.github/actions/setup-swiftlint
        with:
          version: '0.58.2'

      - name: Run SwiftLint
        run: swiftlint

Supported operating systems

  • macOS
  • Linux

Notes

  • This action requires sudo permissions to install the binary to /usr/bin
  • After installation, the swiftlint command will be globally available in PATH
  • If the specified version does not exist, the action will fail with an error message