Skip to content

TRCL-3316 : Trading Rewards Detail Screen Estimated Rewards Card #132

TRCL-3316 : Trading Rewards Detail Screen Estimated Rewards Card

TRCL-3316 : Trading Rewards Detail Screen Estimated Rewards Card #132

Workflow file for this run

name: SwiftLint on Changed Files
on: [pull_request]
jobs:
swiftlint:
name: Run SwiftLint
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch all history so that we can get the proper list of changed files
- name: Get changed files
run: |
echo "CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)" >> $GITHUB_ENV
- name: Install SwiftLint
run: brew install swiftlint
- name: Run SwiftLint on changed files
run: |
# Extract changed files and filter for Swift files
SWIFT_FILES=$(echo "$CHANGED_FILES" | grep -E '\.(swift)$' | xargs)
# Display the list of Swift files to be linted
echo "Swift files to be linted:"
echo "$SWIFT_FILES"
# Run SwiftLint on each changed Swift file
# If no Swift files changed, skip the step
if [ -z "$SWIFT_FILES" ]; then
echo "No Swift files to lint."
else
echo "Linting changed Swift files..."
swiftlint --config dydx/.swiftlint.yml --fix lint -- $SWIFT_FILES
fi