Skip to content

Commit

Permalink
yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ruixhuang committed Nov 6, 2023
1 parent 3541147 commit 24bab1b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/SwiftLint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,25 @@ jobs:
with:
fetch-depth: 0 # fetch all history so that we can get the proper list of changed files

- name: Get changed files
id: changes
# Set outputs using the command.
run: |
echo "::set-output name=all::$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)"
- name: Install SwiftLint
run: brew install swiftlint

- name: List all changed files
id: files
uses: jitterbit/get-changed-files@v1
with:
format: space-delimited
# - name: List all changed files
# id: files
# uses: jitterbit/get-changed-files@v1
# with:
# format: space-delimited

- name: Run SwiftLint on changed files
run: |
# Extract changed files and filter for Swift files
FILES="${{ steps.files.outputs.all }}"
FILES="${{ steps.changes.outputs.all }}"
SWIFT_FILES=$(echo "$FILES" | grep -E '\.(swift)$' | xargs)
# Run SwiftLint on each changed Swift file
# If no Swift files changed, skip the step
Expand Down

0 comments on commit 24bab1b

Please sign in to comment.