Umer Khan
Umer Khan

Reputation: 1

How can i check SwiftLint working on commit and edited file

I'm using Github action to lint the swift language and using SwiftLint for that. I want SwiftLint to check only the committed and edited files in my project. I've tried multiple solutions, but none of them have worked. Any suggestions or guidance would be appreciated.

Here is the YAML file

name: SwiftLint

on:
  push:
    branches:
      - 'cicd'  
  

  pull_request:
    branches:
      - 'cicd'  
  

jobs:
  SwiftLint:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1

      - name: GitHub Action for SwiftLint
        uses: norio-nomura/[email protected]

      - name: GitHub Action for SwiftLint with --strict
        uses: norio-nomura/[email protected]
        with:
          args: --strict

      - name: GitHub Action for SwiftLint (Only files changed in the PR compared to 'main')
        uses: norio-nomura/[email protected]
        env:
          DIFF_BASE: 'main'  # Compare changes in 'cide-sonarqube' against 'main'

      - name: GitHub Action for SwiftLint (Different working directory)
        uses: norio-nomura/[email protected]
        env:
          WORKING_DIRECTORY: Source

Upvotes: 0

Views: 26

Answers (0)

Related Questions