From c5e9d0ffe4071ef4d6353641c2685e18f507bf39 Mon Sep 17 00:00:00 2001 From: Michael Kao Date: Thu, 7 Sep 2023 10:47:25 +0200 Subject: [PATCH] Add formatting. --- .github/workflows/format.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..36197ab --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,31 @@ +name: Format + +on: + push: + branches: + - main + +concurrency: + group: format-${{ github.ref }} + cancel-in-progress: true + +jobs: + swift_format: + name: swift-format + runs-on: macos-13 + steps: + - uses: actions/checkout@v3 + - name: Xcode Select + run: sudo xcode-select -s /Applications/Xcode_14.3.1.app + - name: Tap + run: brew tap pointfreeco/formulae + - name: Install + run: brew install Formulae/swift-format@5.7 + - name: Format + run: make format + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Run swift-format + branch: 'main' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}