Skip to content
shield

GitHub Action

GitHub Action for SwiftLint

3.1.0 Latest version
Use latest version
shield

GitHub Action for SwiftLint

A tool to enforce Swift style and conventions

Installation

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

- name: GitHub Action for SwiftLint
  uses: norio-nomura/action-swiftlint@3.1.0
Learn more about this action in norio-nomura/action-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@v1
      - name: GitHub Action for SwiftLint
        uses: norio-nomura/action-swiftlint@3.1.0
      - name: GitHub Action for SwiftLint with --strict
        uses: norio-nomura/action-swiftlint@3.1.0
        with:
          args: --strict
      - name: GitHub Action for SwiftLint (Only files changed in the PR)
        uses: norio-nomura/action-swiftlint@3.1.0
        env:
          DIFF_BASE: ${{ github.base_ref }}

Secrets

  • Specifying GITHUB_TOKEN to secrets is required to using Check Run APIs for generating annotations from SwiftLint Violations.
  • Since 3.0.0, GITHUB_TOKEN is no longer needed.

Example

Here is an example that actually works. screenshot

Author

Norio Nomura

License

MIT

You can’t perform that action at this time.