action-swiftlint icon indicating copy to clipboard operation
action-swiftlint copied to clipboard

Add output parameters 'violations_count' and 'serious_violations_count'

Open nbeadman opened this issue 8 months ago • 0 comments

Adds the ability to check the number of violations and serious violations to fail action if outside of requirements.

For example, to make sure that no more than 6 violations are allow change the .github/workflows/swiftlint.yml to add the following step:

      - name: Check Violations number
        if:  ${{ steps.swift-lint.outputs.violations_count > 6 }}
        run: |
            echo "::error::This PR exceed maximum number of allowed violations (6). Actual number is (${{ steps.swift-lint.outputs.violations_count }})"
            exit 1
        shell: bash

nbeadman avatar Jun 12 '24 23:06 nbeadman