Git Product home page Git Product logo

action-swiftlint's Introduction

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
      // Simple usage
      - name: GitHub Action for SwiftLint
        uses: mayk-it/[email protected]
      // With custom argument
      - name: GitHub Action for SwiftLint with --strict
        uses: mayk-it/[email protected]
        with:
          args: --strict
      // Only checks files changed in the PR
      - name: Fetch base ref
        run: |
          git fetch --prune --no-tags --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/heads/${{ github.base_ref }}
      - name: GitHub Action for SwiftLint (Only files changed in the PR)
        uses: mayk-it/[email protected]
        env:
          DIFF_BASE: ${{ github.base_ref }}
          DIFF_HEAD: HEAD
      // Runs on different workspace
      - name: GitHub Action for SwiftLint (Different working directory)
        uses: mayk-it/[email protected]
        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 (Modified By Jeremy Klein)

License

MIT

action-swiftlint's People

Contributors

norio-nomura avatar jklein24 avatar m-herold avatar axelguilmin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.