Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
shield

GitHub Action

GitHub Actions for SwiftLint

v5.0.0

GitHub Actions for SwiftLint

shield

GitHub Actions for SwiftLint

A tool to enforce Swift style and conventions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: GitHub Actions for SwiftLint

uses: sinoru/[email protected]

Learn more about this action in sinoru/actions-swiftlint

Choose a version

GitHub Action for SwiftLint

This Action executes SwiftLint and generates annotations from SwiftLint Violations.

Usage

An example workflow(.github/workflows/swiftlint.yml) to executing SwiftLint follows:

name: SwiftLint

on:
  pull_request:
    paths:
      - '.github/workflows/swiftlint.yml'
      - '.swiftlint.yml'
      - '**/*.swift'

jobs:
  SwiftLint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: GitHub Actions for SwiftLint
        uses: sinoru/actions-swiftlint@v5
      - name: GitHub Actions for SwiftLint with --strict
        uses: sinoru/actions-swiftlint@v5
        with:
          args: --strict
      - name: GitHub Actions for SwiftLint (Only files changed in the PR)
        uses: sinoru/actions-swiftlint@v5
        env:
          DIFF_BASE: ${{ github.base_ref }}
      - name: GitHub Actions for SwiftLint (Different working directory)
        uses: sinoru/actions-swiftlint@v5
        env:
          WORKING_DIRECTORY: Source