Skip to content

feather-actions/run-swift-format

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Run Swift Format

This GitHub Action ensures that the Swift code adheres to a consistent coding style by running a script to check the Swift files using swift-format.

Usage

Include the action in the workflow (make sure that a Swift 5.6+ toolchain is on the PATH, on macOS, this should be given, but on Linux, it needs to be installed first, e.g., setup-swift).

Add a .swift-format file to the repository to configure the lint action. If no file is added, the default configuration will be used.

- uses: feather-actions/[email protected]

Full example:

on: [push]

jobs:
  job-name:
    runs-on: macos-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 1
  
      - name: Run Swift Format
        uses: feather-actions/[email protected]

Inputs

These are the optional inputs of the action:

swift-format-version: string input to Swift Format tag version number, default is 510.1.0