norio-nomura/action-swiftlint

GitHub Action for SwiftLint

Swift

393

83 commits

updated Jun 12, 2024

See the code

README

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.2.1
      - name: GitHub Action for SwiftLint with --strict
        uses: norio-nomura/action-swiftlint@3.2.1
        with:
          args: --strict
      - name: GitHub Action for SwiftLint (Only files changed in the PR)
        uses: norio-nomura/action-swiftlint@3.2.1
        env:
          DIFF_BASE: ${{ github.base_ref }}
      - name: GitHub Action for SwiftLint (Different working directory)
        uses: norio-nomura/action-swiftlint@3.2.1
        env:
          WORKING_DIRECTORY: Source

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

docker
github-actions-
github-checks-api
swift
swiftlint

Contributors

norio-nomura

78 commits

m-herold

3 commits

axelguilmin

2 commits

norio-nomura/action-swiftlint

GitHub Action for SwiftLint

Swift

393

83 commits

updated Jun 12, 2024

See the code

README

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.2.1
      - name: GitHub Action for SwiftLint with --strict
        uses: norio-nomura/action-swiftlint@3.2.1
        with:
          args: --strict
      - name: GitHub Action for SwiftLint (Only files changed in the PR)
        uses: norio-nomura/action-swiftlint@3.2.1
        env:
          DIFF_BASE: ${{ github.base_ref }}
      - name: GitHub Action for SwiftLint (Different working directory)
        uses: norio-nomura/action-swiftlint@3.2.1
        env:
          WORKING_DIRECTORY: Source

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

docker
github-actions-
github-checks-api
swift
swiftlint

Contributors

norio-nomura

78 commits

m-herold

3 commits

axelguilmin

2 commits

Languages

Swift

70.6%

Shell

18.6%

Dockerfile

10.8%