Files

40 lines
1.0 KiB
YAML

name: Format and push
# Github action will require permission to write to repo
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: true
ref: ${{ github.event.pull_request.head.ref }}
- name: Install Flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2
with:
channel: stable
- name: Install dependencies
run: flutter pub get
- name: Format Dart code
run: dart format .
- name: git config
run: git config --global --add safe.directory /__w/sdk-for-flutter/sdk-for-flutter # required to fix dubious ownership
- name: Add & Commit
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
with:
add: '["lib", "test"]'