Skip to content

About

Install a pinned SwiftFormat and lint with GitHub Actions annotations

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SwiftFormat

A GitHub Action that installs a pinned SwiftFormat and runs swiftformat --lint with GitHub Actions annotations. Designed to compose with the rest of the Apple-Actions suite:

Usage

Pin a version

- uses: Apple-Actions/swiftformat@v1
  with:
    version: 0.64.4

Pin from a file

Put the version on the first non-comment line of a file (for example .swiftformat-version):

0.64.4
- uses: Apple-Actions/swiftformat@v1
  with:
    version-file: .swiftformat-version

If both version and version-file are set, version wins. If neither is set, the action installs the latest SwiftFormat release.

Options

- uses: Apple-Actions/swiftformat@v1
  with:
    version: 0.64.4
    path: Sources
    reporter: github-actions-log
Input Default Description
version SwiftFormat version (for example 0.64.4) or latest
version-file Path to a file containing the version
path Path to lint (defaults to .)
args Extra arguments appended to swiftformat
reporter github-actions-log SwiftFormat reporter
lint true Pass --lint so files that would change fail the step
token ${{ github.token }} Token for GitHub Releases API / downloads
Output Description
version Resolved SwiftFormat version that was installed
swiftformat-path Absolute path to the swiftformat binary

Works on ubuntu-* and macos-* runners (downloads the matching macOS / Linux release asset). Honors a workspace .swiftformat config when present. Submodule paths listed in .gitmodules are excluded automatically unless you already pass --exclude.

About

Install a pinned SwiftFormat and lint with GitHub Actions annotations

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages