Delete 315BD5F8-2F73-4CE8-9166-B5F896C8A9D5_4_5005_c.jpeg #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SwiftLint Autocorrect | |
on: | |
pull_request: | |
push: | |
branches: | |
- main # Adjust this to target the branch you want to lint | |
jobs: | |
lint: | |
runs-on: macos-latest # macOS is required for SwiftLint | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
- name: Install SwiftLint | |
run: | | |
if ! command -v swiftlint &> /dev/null; then | |
echo "Installing SwiftLint..." | |
brew install swiftlint | |
fi | |
- name: Run SwiftLint autocorrect | |
run: | | |
echo "Running SwiftLint " | |
swiftlint --fix | |
# Optional: Commit and push changes if autocorrect made modifications | |
- name: Commit SwiftLint fixes | |
run: | | |
if [[ `git status --porcelain` ]]; then | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Apply SwiftLint autocorrect fixes" | |
git push | |
fi |