diff --git a/.github/workflows/formatter.yaml b/.github/workflows/formatter.yaml new file mode 100644 index 00000000..be590a48 --- /dev/null +++ b/.github/workflows/formatter.yaml @@ -0,0 +1,24 @@ +on: + push: + pull_request: + +name: Format Code + +jobs: + build: + name: format code + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Flutter + uses: subosito/flutter-action@v1 + - name: Format code + run: | + dart format --line-length 110 \ + $(find lib test -name '*.dart' -not -name '*.g.dart' -and -not -name '*.freezed.dart') + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "dart format ✅" + branch: ${{ github.head_ref }}